Maxima-function logxor does not work under Sbcl



Oliver Kullmann wrote:
> Hello,
>
> Maxima 5.25.1 http://maxima.sourceforge.net
> using Lisp SBCL 1.0.53
> Distributed under the GNU Public License. See the file COPYING.
> Dedicated to the memory of William Schelter.
> The function bug_report() provides bug reporting information.
> STYLE-WARNING: redefining MAXIMA::ADD-LINEINFO in DEFUN
> STYLE-WARNING: redefining MAXIMA::$LOAD in DEFUN
> (%i1) load(functs);
> Evaluation took 0.0180 seconds (0.0190 elapsed) using 3.045 MB.
> (%o1) "/home/kullmann/OKplatform/ExternalSources/Installations/Maxima/sbcl/5
.25.1/share/maxima/5.25.1/share/simplification/functs.mac"
> (%i2) logxor(1,1);
> Evaluation took 0.0000 seconds (0.0010 elapsed) using 0 bytes.
> (%o2) 1
>
> which should return 0, which it does under CLisp and Ecl, e.g.
>

I have the same result on my machine, however when i do the same computation
directly in lisp the result is Ok
lilas% sbcl
This is SBCL 1.0.51.0-a546163, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>;.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* (boole boole-xor 1 1)

0
* (boole boole-xor 1 2)

3
*

So an error creeps in the file functs.mac or whatever. An indication, in
functs.mac one finds the definition
logxor(x,y):=?boole(6,x,y)$

which i think means (boole 6 x y) in lisp. But in maxima-sbcl i get:
lilas% maxima
(%i1) :lisp (print cl:boole-xor)

8


The CLHS says that the values of stuff like boole-xor is
"implementation dependant". This means that the definition in funcs.mac is
buggy, it should specify boole-xor and not an absolute number like 6, which
changes from implementaion to implementation.

In short someone should fx the definition of logand, logor and logxor in
funcs.mac, and replace 1, 7, 6 by appropriate lisp constants,
boole-and boole-ior boole-xor.











-- 
Michel Talon