Some random thoughts on future features



>>>>> "Donna" == Donna and Dan Stanger <dan.stanger@ieee.org> writes:

    Dan> In the given expample, the bigfloat class just serves as a
    Dan> marker.  Maxima bigfloats are implemented as ((BIGFLOAT
    Dan> SIMP precision) mantissa exponent).  All the other Maxima

Yes, that's maxima's view of bigfloats.  But the actual routines want
(mantissa exponent).

    Dan> objects are implemented in the same way.  It seems to me
    Dan> that we should implement this by using the Meta Object
    Dan> Protocol, creating a Maxima class, and have bigfloat and
    Dan> others be subclasses of this.  Using the MOP, we can
    Dan> implement these subclasses directly as Maxima objects, that
    Dan> is have the class representation for bigfloat, for example
    Dan> be ((BIGFLOAT SIMP precision) mantissa exponent).

I don't know anything about the MOP to say, but since MOP isn't really
standardized, I wouldn't want to use it unless we really get some key
advantage from it.

    Dan> Another way of implementing this is to define, for example,
    Dan> (defmethod bf-sqrt ((x bigfloat)) as
    Dan> (defmethod bf-sqrt ((x (eql (caar 'bigfloat))) ; I think this is the correct syntax

I don't think that's right.  (x (eql foo)) works if x is eql to foo,
which is a known object.  I think what you have means the method
applies when x is eql to '(caar bigfloat), which isn't what you want.

Methods dispatch on types, so it has to be a known type.

Ray