[Maxima] errors in tests

Viktor T. Toth vttoth at vttoth.com
Fri Apr 20 15:52:24 CDT 2007


The problem was in simp.lisp, where in one of your recently restored memq
calls you accidentally left in a #'eq.

I committed a fix, the test suite runs cleanly now.

BTW, I agree that keeping memq is useful; a small (perhaps even nonexistent)
loss of performance is worth paying in exchange for a significant
improvement in code readability.


-----Original Message-----
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
On Behalf Of Stavros Macrakis
Sent: Friday, April 20, 2007 3:29 PM
To: andreas_eder at gmx.net
Cc: maxima at math.utexas.edu
Subject: Re: [Maxima] errors in tests

On 4/20/07, Andreas Eder <aeder at arcor.de> wrote:

If it was my edits which introduced the errors, I'm sorry.  I'll try to be
more careful. 

	And besides I don't think it was a good thing to reintroduce memq 
	instead of the proper CL idiom of using member with :key '#eq.

Memq is a simple, handy function for a very common case.  Simply because
Common LIsp doesn't happen to define it in the default libraries doesn't
mean that we can't define it for our comfort and convenience. 

The full generality of (member ... :key ..) is certainly a nice capability
which has many uses, but compact notation makes it easier to read and write
code.  Defining functions and macros isn't only for performance, it is also
for clarity. 

By the way, in GCL at least, (memq...) and (member... '#eq) compile to the
same thing, so this is not about efficiency, it is about clarity.  That
said, if I were confident that (member 'x ...) and (member ... '(x y z))
(where x, y, z are all symbols) compiled to (member ... '#eq) in all the
implementations we care about, I suppose I would simply use member *without*
the :key construction. 


More information about the Maxima mailing list