pop and push macros



Dan--

> Do EXAMPLE(PUSH); for an executable example.

I do not have access to commercial Macsyma!  If I did, of course I could
have checked the documentation, tried out some examples, etc.  Not
having access to the commercial Macsyma has the advantage of leaving me
completely "uncontaminated" in an intellectual property sense.  (Though
reverse engineering under U.S. law at least does not typically lead to
contamination.)

In Common Lisp, Push and Pop are destructive operations on L-values.
The definitions you give for Macsyma Push and Pop are ambiguous.

An example of CL's destructive operations:

  (setq xx nil) => nil
  (push 'qq xx) => (qq)
  xx => (qq)

You *cannot* use them functionally:

* (push 'qq '(a b c))
    => Error: Cannot expand the SETF form (QUOTE (A B C)).

Note that xx is used for its L-value, NOT for its ordinary value.  Any
setf'able object can be pushed onto, e.g.

  (setq yy (list 'a 'b 'c)) => (a b c)
  (push 'qq (cdr yy)) => (qq b c)
  yy => (a qq b c)

My question was whether commercial Macsyma had a setf system like this.
Maxima does not.  Though you can do:

  ll[2]:qq;

you cannot do

* rest(xx):[qq]; => Improper value assignment

If Macsyma's Pop does not modify the old value, then it does not need to
be a macro, only a simple function.  If it *does* modify the old one, it
*does* need to be a macro, and it depends on some sort of setf function,
which Maxima doesn't have.  Does Macsyma?

     -s