full_listify bug?



Thanks--I'll fix it. If you haven't already, file a bug report.

The function full_listify has other problems--it can return
an unsimplified result.

I think a better fix is to make full_listify work more like:

 (%i7) myfull_listify(e) := subst("[", 'set, e);
 (%o7) myfull_listify(e):=subst("[",'set,e)

 (%i8) myfull_listify(rat(3/4));
 (%o8) 3/4

 (%i9) myfull_listify(set(set(a), set(a,b), [p, set(43)]));
 (%o9) [[a],[a,b],[p,[43]]]

I see that %o8 isn't a CRE expression. I'd say that is a subst bug?

Barton

-----maxima-bounces at math.utexas.edu wrote: -----


>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.
>
>_______________________________________________
>Maxima?mailing?list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima