full_listify bug?



Barton/Stavros,
I believe that the following is undesirable behaviour:

(%i1) full_listify(3/4);
(%o1) 3/4
(%i2) full_listify(rat(3/4));
Maxima encountered a Lisp error:
  Type-error in KERNEL::OBJECT-NOT-LIST-ERROR-HANDLER:  4 is not of type
LIST

We can fix this by changing the first condition in $full_listify to a
test for mapatoms, not just atoms:

(%i3) to_lisp();
MAXIMA> (defun $full_listify (a)
   (cond (($mapatom a) a)
         (($setp a) `((mlist simp) ,@(mapcar #'$full_listify (cdr a))))
         (t `(,(car a) ,@(mapcar #'$full_listify (cdr a))))))
MAXIMA> (to-maxima)
(%i4) full_listify(rat(3/4));

(%o4) 3/4

Leo

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.