Why is *print-circle* set to T by default? WAS: grinding, etc.
Subject: Why is *print-circle* set to T by default? WAS: grinding, etc.
From: Stavros Macrakis
Date: Wed, 9 Feb 2011 11:56:15 -0500
Michel,
The problems you describe below go away if you set *print-circle* to NIL.
As for creating a formula suitable for evaluation by C, I don't understand
why you're looking at grind or print at all: I'd think that you'd want to
start with the code of the fortran command and modify it as necessary. (I'd
have thought someone has already written a Maxima-to-C printer.)
-s
On Wed, Feb 9, 2011 at 11:40, Michel Talon <talon at lpthe.jussieu.fr> wrote:
> Stavros Macrakis wrote:
>
> > I don't know why *print-circle* is set to T by default in Maxima -- it
> > makes human reading of printed sexpressions much harder, even when there
> > *are*
> > repeated subexpressions -- see examples below.
>
> Indeed doing that allows to always see the pair (operator SIMP) in the
> correct place, and thus reconstruct a formula appropriate for
> C evaluation, by locating the operator and its arguments.
> With x:y*(z + t^2 ) i had (as in your example) :
>
> MAXIMA> #$x^2$
>
> ((MTIMES . #1=(SIMP)) (#2=(MEXPT . #1#) $Y 2)
> (#2# ((MPLUS . #1#) (#2# $T 2) $Z) 2))
>
> and the #2 was even more worrisome for my purpose than the #1. Here the
> expression is "simplified" to y^2*(z+t^2)^2 so now we have three
> (MEXPT SIMP) which are shared under #2, not that obvious to the beginner.
>
>
> Grind doesn't mess with print-circle, but from what i have tested when
> picking sufficiently small parts of the above expression with car cdr cddr
> etc. the #n automatically get substituted at some point.
>
> --
> Michel Talon
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>