Subject: multiple assignment stuff in src/mlisp.lisp
From: Albert Reiner
Date: 06 Mar 2007 22:20:58 +0100
["Robert Dodier" <robert.dodier at gmail.com>, Mon, 5 Mar 2007 21:57:00 -0700]:
> I made a minor change to the multiple assignment stuff.
> The results for inputs %i1--%i10 are the same as before.
> One of the others changed.
Great! Just one more point I would like to raise:
> (%i18) a : [1, 2, 3, 4];
> (%o18) [1, 2, 3, 4]
> (%i19) (i:0, [ a[i : i + 1], a[i : i + 1] ] : [ a[i : i + 1], a[i : i + 1] ]);
> (%o19) [1, 2]
> (%i20) a;
> (%o20) [1, 2, 1, 2]
Here my naive expectation would have been [3, 4, 3, 4], due to the
following sequence of steps:
- i: 0
- partially evaluate the left hand side of the assignment, giving [
a[1], a[2] ] and setting i: 2
- evaluate right hand side to [3, 4]
- assign [ a[1], a[2] ] : [3, 4]
Best regards and thanks for your work,
Albert.