declarations



On Mon, May 4, 2009 at 1:48 PM, Leo Butler <l.butler at ed.ac.uk> wrote:

> I am trying to mimic perl's implementation of objects as blessed hashes.
> In my case, I define a feature, semi_simple_lie_algebra, and functions
> (`methods') that operate on objects that are declared to have this
> feature.

Maxima already has a structured object mechanism via defstruct.
Sorry, it's not documented but it's pretty simpled-minded.
See the examples in share/contrib/rtestdefstruct.mac.

Are Lie algebra objects going to always be literals (i.e. nonatomic
expressions which have op(expr) = 'lie_algebra) or do you want to
work with symbols declared as Lie algebras? defstruct addresses
the former problem and declare/featurep the latter ....

Maxima would benefit from a general type mechanism. Some
pieces exist.

FWIW

Robert Dodier