multiple assignment stuff in src/mlisp.lisp



evaluating x,y,z  is not the issue, it seems.
in this case where you do  [i,z[i],...] : [......]

the question is, in what order is the location for a,b,c computed.


Stavros Macrakis wrote:

> I see the code actually specifies the behavior in cases like this:
>
> > ;; [a,b,c]:[x,y,z] means about the same as a:x, b:y, c:z.  Actually it
> > ;; evaluates x,y,z  BEFORE any assignments to a,b,c, hence parallel. 


it seems for   i:0,  [i,z[i]]  :  [r(i),s(i)]
you should evaluate r0= r(0), s0=s(0),   then set  i to r0, and z[r0] to s0.

If you want to switch two values,  eg..   [x,y]:[y,x],
this works.
If you want to switch two values, eg  [i,z[i]] : [z[i],i]
it doesn't work.

I think this is consistent with Algol 60.

>
>
> If these are the semantics we want, they're easier to implement than 
> the left-to-right semantics I was assuming.
>
> But the code apparently doesn't do what it says it does....
>
>               -s
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Maxima mailing list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima
>  
>