Some random thoughts on future features



No comment on the conditions issue..
I don't know why bessel_j doesn't return numbers.


On CLOS and bigfloat and other number types...

I've thought about this in the past at various times, and it is
not likely that I will recall all the issues off the top of my head,
but here are a few.
1. You can't overload the built-in operators like + and * with CLOS.
This means that the "most natural" extension of CL to bigfloats is
unavailable. This may not matter if you use PLUS instead of + etc.

2. It is not so clear how to combine stuff.  For example,
bigfloats of different precision.  Rational + float could be
made into a rational.  It could be made into a float unless it overflows.

If you add a+b+c+d,  it may make sense to look at the types of all the
operands before adding any two of them.

There are many papers in the computer algebra literature espousing the
use of a different kind of "type" system that imposes some algebraic
structure rather than some data abstraction inheritance structure.
That is, notions of rings, fields, polynomials over rings, etc.  rather
than built-in numbers, arrays of built-in numbers, etc.

Axiom uses this.  Mupad maybe uses this. Maple has a system "Gauss" that
professes to use this. Foderaro's "Newspeak" system used something like
this.  Zippel's Weyl system too.

Not to say that using CLOS would be bad, just that the thoughts along
these lines can be pushed in different dimensions.

RJF



Raymond Toy wrote:

>While looking at some old mail messages and what not, I started to
>think about a few small things.
>
>First, it seems that maxima now requires gcl in ANSI mode.  (Is that
>right?)  If so, gcl ansi-mode has conditions, I think.  Can we start
>thinking about signaling better conditions?  The immediate use of this
>is in adaptive plotting.  It treats any kind of error as a singularity
>and tries to refine the plot.  So if you do something like
>plot2d(bessel_j[0](x)) (Note: it should be bessel_j(0,x)!), the
>adaptive plotter just generates a bunch of points but ends up plotting
>nothing, because no numbers were returned.  And until you realize
>what's happening, you'll think it's a bug in plot2d.
>
>Second, while playing with the elliptic functions and integrals, I
>noticed that many of the numerical algorithms there are not specific
>to a float implementation.  They are, in fact, valid for bigfloats,
>complex, and even bigfloat complex values.  
>
>But hand writing a version for each of these is a pain.  I was
>thinking that since every lisp we support has CLOS, could we not use
>CLOS to define a bigfloat class and a complex-bigfloat class and add a
>few methods to compute the basic functions for these classes?  The
>bigfloat class would basically use the current bigfloat routines.  The
>complex-bigfloat would just be the obvious extension.
>
>What do people think about this?
>
>Ray
>
>
>_______________________________________________
>Maxima mailing list
>Maxima@www.math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima
>  
>