revising ev, was: problem with "concatting variables"
Subject: revising ev, was: problem with "concatting variables"
From: Stavros Macrakis
Date: Thu, 26 Sep 2013 15:58:13 -0400
On Thu, Sep 26, 2013 at 2:27 PM, Robert Dodier <robert.dodier at gmail.com>wrote:
> ...
>
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.
>
Yes, some power users would find that useful -- maybe something like the
Lisp comma convention `(... ,x) should be added to buildq, e.g.
buildq([],1+unquote(x))
But I don't think it should share the name 'eval', it should have a unique
name not used elsewhere to avoid confusion. But in any case, I don't think
regular (non-power) users will find this particularly useful.
By the way, in looking at the doc for buildq, I see one place we are
misleading users:
Examples
`a' is explicitly bound to `x', while `b' has the same binding
(namely 29) as in the calling context, and `c' is carried through
verbatim. The resulting expression is not evaluated until the
explicit evaluation `''%'.
(%i1) (a: 17, b: 29, c: 1729)$
(%i2) buildq ([a: x, b], a + b + c);
(%o2) x + c + 29
(%i3) ''%;
(%o3) x + 1758
Note the incorrect statement the explicit evaluation `''%' !! Argh!! No
wonder users are confused!
-s