Robert Dodier wrote:
> On 12/31/06, Michel Van den Bergh <michel.vandenbergh at uhasselt.be> wrote:
>
>> What is the best way to check that an expression evaluates to an lvalue?
>> I.e. a variable or a subscripted variable?
>
>
> How about this --
>
> P(e) := symbolp(e) or subvarp(e);
>
> P(a) => true, P(a[1]) => true, P(a[n]) => true, P(a + b) => false
>
> Note also P("foo") => true (because "foo" is a symbol).
Hmm, a string is not an lvalue (something that can appear on the
left hand side of an assignment). "describe" claims that there is
a function "stringp" but on my version of maxima stringp appears
not to do anything. Is this a bug?
Michel
>
> Hope this helps,
> Robert Dodier