revising ev, was: problem with "concatting variables"
Subject: revising ev, was: problem with "concatting variables"
From: Richard Fateman
Date: Thu, 26 Sep 2013 13:07:41 -0700
On 9/26/2013 11:27 AM, Robert Dodier wrote:
> Stavros Macrakis <macrakis <at> alum.mit.edu> writes:
>
>> We should really define some clean functions for well-defined subsets
>> of the functionality of ev.
> Agreed.
>
>> In particular, eval(...) should do the obvious thing.
>> It is trivial to define: (defun $eval (x) (meval x)).
In terms of user friendliness, is this the right name for the average user?
after all
x:43;
1+x;
comes out 44 because 1+x is evaluated ... to 1+43 and then
simplified to 44.
So everything you type in gets evaluated, though with a few exceptions
like x
in lambda([x] ...)
Maybe a better name would be something like re_eval( E); ? almost the
same as ev(E) ?
As food for thought, I offer a description of how Mathlab '68 did
evaluation. At
least as I recall. It was kind of the reverse of Lisp's quote where 'x
means the
symbol x, not its binding or value.
Anyway
x:=43;
1+x; returns 1+x.
1+'x; returns 1+43 or 44.
This works nicely with diff(f(x),x) begin the differential form
quoted, and
'diff(f(x),x) as the "verb" to compute the derivative.
I suppose you could write ''x to evaluate twice.
To expect any scheme to really satisfy everyone is probably
unrealistic. Even
after decades of trying to hash this out, Mathematica has a
mind-boggling mess
of 'features'. By default the evaluation there corresponds to ev(E,
infeval), but
with some kind of criterion that 'if it doesn't change, stop.' This
doesn't quite work
all the time but that's the idea.
RJF
> That's a good idea. It occurs to me that a user might expect
> 'eval' or any evaluation function to evaluate stuff in contexts
> in which it isn't otherwise.
> E.g. '(1 + eval(x)) => (1 + <value of x>) ??
> I'm not too attached to this idea -- just throwing it out for
> consideration.
>
>> Do we have any idea why Redfern et al. proposed this peculiar
>> way of handling indexed variables? Is it a workaround for the
>> failure of Maxima/Macsyma to treat subscripted variables as
>> first-class variables in some contexts? (Can we inventory those
>> contexts and fix them systematically?)
> Agreed.
>
> best
>
> Robert Dodier
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima