More on memq



OK, I looked at simp.lisp, where I assume most of the memq -> member stuff
happened.

I am in the process of changing it back to memq so I can use a macro.

I found stuff like (member z '(-1 -1.0) #'equal)
which is, I think, wrong. 


If z is 1.0d0, then it is not equal.


I think that what is meant is      (= z -1)
  The value, other than nil or non-nil, is discarded.

I also put in a macro memq2  that is good if the 2nd arg is exactly 2 long,
which seems to be most of the time.

When I am done, I will see if I can benchmark this.

If the demo test files are spending most of their time looking for files, it
is kind of a silly test.


RJF




 

> -----Original Message-----
> From: maxima-bounces at math.utexas.edu 
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Robert Dodier
> Sent: Saturday, April 12, 2008 12:29 PM
> To: Raymond Toy
> Cc: fateman at EECS.Berkeley.EDU; Andreas Eder; maxima at math.utexas.edu
> Subject: Re: [Maxima] More on memq
> 
> On 4/12/08, Raymond Toy <toy.raymond at gmail.com> wrote:
> 
> > Robert Dodier wrote:
> 
> > > A much better reason for replacing archaisms with CL is that
> > > outsiders (i.e., anyone who has spent less than a couple of
> > > years on the project) will understand the code better.
> 
> >  You keep saying this, Robert, by why don't you encourage 
> people to make
> > truly substantive changes like adding comments to the code?
> 
> Well, I encourage people to do all kinds of stuff, even though
> much of it is ignored. You are certainly free to encourage whatever
> you like, maybe you will get better results than me.
> 
> FWIW
> 
> Robert Dodier
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>