--- Robert Dodier <robert.dodier at gmail.com> wrote:
> Hello Andrew,
>
> > How can I just sandwich lisp in maxima like
> "1+f(10) +
> > lisp((+ 1 2 (the :three) 4)) + 2"? (where "lisp"
> is a
> > maxima macro and "the" is a shadowed symbol which
> > is now a lisp macro).
>
> I wouldn't try too hard to wedge Lisp input into
> Maxima.
> It can be done, but the result will be clumsy; I
> doubt if
> it will be popular with your users.
>
> Better for your users to adapt the Lisp objects in
> question
> to something Maxima is comfortable with.
> It is really quite simple: Maxima prefers
> user-visible symbols
> to begin with $ or %, and requires every nonatomic
> expression
> to have a car which is a list; the caar is the name
> of the operator.
>
> For example, I'll guess that rule objects look
> something like
> (<antecedent> <consequence>) at present.
> Maxima parses 'if <antecedent> then <consequence>
> into ((%mcond) <antecedent> <consequence> t nil).
> If that's not convenient we can talk about
> user-defined operators.
> In any event, the goal is to get Maxima to do the
> parsing.
I think it would end up being hybrid parsing. What I
would like to do is something like:
(defobject car ()
:attributes
((velocity :modifiable 10)
(mass 1000)
(kinetic-energy :math 1/2*(the mass)*(the
velocity)^2)))
This is just like my current defobject macro, but when
it would see the declaration ":math" it would take
everything before the closing paren to be infix or
maxima notation.
All the kids at my school have been taught either
MATLAB or FORTRAN to do their engineering problems,
and I would not want a KBE system to be backwards
seeming to them.
I guess I need to write a parser to do this.
AKW