This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: (remove) doesn't work


On Wed, 2004-05-19 at 15:08, mskala@ansuz.sooke.bc.ca wrote:
> On Wed, 19 May 2004, Jim Kingdon wrote:
> > Yeah.  The only thing that spring to my mind is whether xconq has
> > lists of lists, and whether you'd want
> > 
> > remove (c d) from (a b (c d) e) to return (a b e)
> > 
> > Off the top of my head I don't even remember whether xconq has lists
> > of lists, much less whether the above functionality is important.
> 
> I'm sure xconq has lists of lists, but it seems to me that if you want to
> remove (c d) from (a b (c d) e) and return (a b e), you should use
> 
>   (remove ((c d)) (a b (c d) e))
> 
> not
> 
>   (remove (c d) (a b (c d) e)) .

I just looked at a Common Lisp reference, and it sides with Jim's
interpretation of the 'remove' keyword. Not that we have to follow Lisp
or anything....

Perhaps we could implement a separate 'remove-list' keyword, which would
follow your suggestion (and probably be more useful for GDL). If we
assume that order of atoms in the two lists need not match, then the
operation will effectively be O(n^2), which is probably not a big deal,
since it would only be used during game module interpretation.

Eric


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]