This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Re: (remove) doesn't work
- From: Eric McDonald <mcdonald at phy dot cmich dot edu>
- To: mskala at ansuz dot sooke dot bc dot ca
- Cc: Jim Kingdon <kingdon at panix dot com>, xconq7 at sources dot redhat dot com
- Date: Mon, 07 Jun 2004 21:07:14 -0600
- Subject: Re: (remove) doesn't work
- References: <Pine.LNX.4.21.0405191706380.28373-100000@diamond.ansuz.sooke.bc.ca>
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