revising ev, was: problem with "concatting variables"



On 10/04/2013 04:36 AM, Robert Dodier wrote:

>
>  * alias -- just causes confusion
>

I think the problem is even worse than what I normally think
of as an alias.

Here, %solve is an alias for to_poly_solve.

(%i1) load(to_poly_solve);
*** output flushed ***
(%i2) to_poly_solve;
(%o2)                               %solve
(%i3) 'to_poly_solve;
(%o3)                               %solve
(%i4) sconcat(to_poly_solve);
(%o4)                               %solve
(%i5) sconcat('to_poly_solve);
(%o5)                               %solve

Now it is difficult to use the symbol to_poly_solve
from maxima.

--------------------------------

What is going on? Maybe the documentation is
wrong and to_poly_solve is an alias for %solve.

(%i1) alias(bill,ted);
(%o1)                               [bill]

According to the documentation, which is not very explicit, ted is the
<old-name>, and bill is the <new-name>

I understand this to mean that bill is an alias for ted.

(%i2) :lisp (trace meval)

(%i2) bill;
   0: (MEVAL $TED)
   0: MEVAL returned $TED
(%o2)                                bill

Maybe this makes sense, maybe not.
bill is an alias for ted, so evaluate
ted. ted is unbound, so what do we display,
bill or ted ? bill is displayed.


(%i2) ted;
   0: (MEVAL $TED)
   0: MEVAL returned $TED
(%o2)                                bill

$ted appears to be a symbol which is unbound.
But an alias to it, bill, is displayed.

The following confirms that ted is indeed the old symbol,
it is the one that is bound.

(%i4) ted : 42;
   0: (MEVAL ((MSETQ) $TED 42))
     1: (MEVAL 42)
     1: MEVAL returned 42
   0: MEVAL returned 42
(%o4)                                 42
(%i5) bill : 42;
   0: (MEVAL ((MSETQ) $TED 42))
     1: (MEVAL 42)
     1: MEVAL returned 42
   0: MEVAL returned 42
(%o5)                                 42
(%i6) :lisp $ted

42

(%i6) :lisp $bill

Maxima encountered a Lisp error:

  The variable $BILL is unbound.

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.

-----------------------------------------

Following is a nice bit of slapstick:

(%i1) alias(curly,moe);
   0: (MEVAL (($ALIAS) $CURLY $MOE))
   0: MEVAL returned ((MLIST SIMP) $MOE)
(%o1)                               [curly]
(%i2) alias(larry,moe);
   0: (MEVAL (($ALIAS) $LARRY $MOE))
   0: MEVAL returned ((MLIST SIMP) $MOE)
(%o2)                               [larry]
(%i3) moe;
   0: (MEVAL $MOE)
   0: MEVAL returned $MOE
(%o3)                                larry
(%i4) curly;
   0: (MEVAL $MOE)
   0: MEVAL returned $MOE
(%o4)                                larry
(%i5) larry;
   0: (MEVAL $MOE)
   0: MEVAL returned $MOE
(%o5)                                larry

etc...

It appears that alias sets the symbol property
reversealias for A to the last symbol that
was aliased to A, and this is looked up when
A is displayed.

-----------------------------------------
> > Or if not deprecated, state clearly that some feature has very
> > limited use.
>
>  I'm opposed to that. I really can't stand moralizing "Well, you really
>  shouldn't be doing that" documentation. The documentation should simply
>  state what the feature does. It's up the reader to draw any conclusions.
>  If we really don't want some feature, just get rid of it.
>
>  best
>
>  Robert Dodier
>
>  _______________________________________________
>  Maxima mailing list
>  Maxima at math.utexas.edu
>  http://www.math.utexas.edu/mailman/listinfo/maxima