RE: Wishing well

郭雪松 <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <[email protected]>
Beleave me, ByValue.pmod is almost the most useful pmod I ever wrote.

The reason not convert to string is most likely the items are objects. and they come from another module out of our control.

Guo Xue Song


> Date: Tue, 18 Nov 2014 23:27:53 +1100
> Subject: Re: Wishing well
> From: [email protected]
> CC: [email protected]
> To: [email protected]
> 
> On Tue, Nov 18, 2014 at 11:24 PM, 郭雪松 <[email protected]> wrote:
> > Consider this:
> >
> > Howto create a array of multiset, every item of the array should be uniq.
> > using ByValue, I do it like this:
> >
> > array res=({});
> > multiset done=(<>);
> > for(int i=0;i<100;i++){
> >  for(int j=0;j<100;j++){
> >   int t=random(100);
> >   object ob=ByValue.Set(i,j,t);
> >   if(!done[ob])
> >    res+=({(<i,j,t>)});
> >  }
> > }
> 
> Hmm. Seems an unusual thing to do... although this is a contrived
> example, and they never look particularly impressive.
> 
> Are you able to represent the sets as strings? An array (or multiset)
> of strings is pretty efficient and easy to work with.
> 
> ChrisA
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.