On Fri, Nov 20, 2009 at 12:47 PM, Robert Dodier <robert.dodier at gmail.com> wrote:
> On Mon, Nov 16, 2009 at 12:23 PM, Conrad Schiff <gravmath at yahoo.com> wrote:
...
> There is an automatically defined "last result" variable which
> obviates the need for a named intermediate variable.
...
> diff (my_expr, t);
> ev (%, t=0);
>
> Sometimes it's clearer to break up a computation into
> steps in which % from one step is processed in the next.
> Maybe that's helpful to you.
...
Presumably the problem here is that users have the expectation that ev
is functional, that is, that f(g(x)) == ( temp: g(x), f(temp) ). In
fact, of course, ev (unlike Lisp eval) us not a function, but a
context-creating operation (among other things!).
The problem is that many users seem to think that 'ev' is a function,
presumably interpreting ev(...,a=1) as "substitute 1 for a in ..."
rather than "interpret ... in a context where a=1".
I am not quite sure what to recommend here. I would really like to
get rid of ev entirely, but it is simply too convenient for many
operations. But its very convenience (which throws together a bunch of
special cases into a simple, seemingly uniform, syntax) is the cause
of its complexity. For example, if we made it functional, then you'd
get what you expect for ev(x+1,x=2) (viz. 3), but I suspect that the
result of ev(print(x),x=2) would be a surprise (viz. it would print
out the literal x and return the value 2).
-s