Indexing access for Lists and Maps considered harmful?

Talden talden at gmail.com
Mon Jun 22 18:25:20 PDT 2009


> ...  We can have that if the construct is defined by
> translation as:
>
> var tmp = "c";
> map.put("b", tmp);
> tmp

This is my preference too...

m[a] = n[a] = x; // where m and n are maps.

becomes

X t = x;
m.put(a, t); n.put(a, t);
t;

Does semantically treating all multi-assignments this way break existing code?

a = b = c;

C t = c;
a = t; b = t;
t;

Are there ways to get other side-effects in the current grammar? If
not, defining it this way makes defining it for indexed access easier.

PS: I've thought about this just long enough to write this email, it's
one of those days... I must have missed something that makes this a
more complex discussion other than 'this is how we should define the
value of an indexed access expression'.

--
Talden



More information about the coin-dev mailing list