On 8/28/06, Barton Willis <willisb at unk.edu> wrote:
> The first thing my code does is check to see if either argument is in
> $arrays. When that is the case, it decides if the arguments are the
> equal as arrays. Thus:
>
> (%i12) is(equal('q,'r));
> (%o12) false
So q[1]:r[1]:1$ is(equal('q,'r)) => true
but q:q[1]:r[1]:1$ is(equal('q,'r)) => false
Is that right?
That is treating 'q' as a single object which has both a scalar value
and an array value, and comparing on both of them. I think this is
confusing. I would think it would be clearer to compare just the
scalar values. After all, array values aren't first-class citizens in
other ways, either. For example,
p[1]:2$
s:p$
s[1] => s[1]
If you can't assign the array value with ":", why can you compare it with "="?
We currently have no way in Maxima of referring to the array value (or
for that matter the functional value) of an identifier. This causes
problems for assignment, for comparison, for the assume/declare
system, etc. Maybe we should think about how to fix this.
-s