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: Richard Fateman
Date: Wed, 09 Feb 2011 17:23:55 -0800
On 2/9/2011 4:38 PM, Michel Talon wrote:
> Stavros Macrakis wrote:
>
>> 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.)
>>
> Indeed these problems disappear. As to why i cannot start from the fortran
> command, or f90, it is because i want to produce formulas for multiprecision
> computation which have awkward syntax such as pow(x, expnt) but also
> add(x, y, z,...) instead of x+y+z, and similarly for all operations. This
> is for using by some java program, and java doesn't allow overloading of
> operators +, *, ... so that only awkward syntax is available. I also need to
> write for Gnu GMP under C++, which has some nasty notations. Moreover i want
> to do these computations for complex numbers, so i have to promote reals to
> complex numbers when they appear in the expressions, etc. So it is very
> necessary to somewhat analyze the expressions.
There is another approach possible, but may be impractical for you to use.
GMP or MPFR or similar code
can be called directly from lisp via foreign function calls. Lisp
allows plus, times
etc to be overloaded.
MPFR is much faster than bfloats.
This suggestion means you don't need C++ or Java.
An old paper..
http://www.cs.berkeley.edu/~fateman/generic/overload-small.pdf
code in here
http://www.cs.berkeley.edu/~fateman/generic/
Depends on how much more lisp you want to learn and whether you would
just use it
for all your computing (with suitable libraries)
RJF