Dan Doel
10/29/2003 10:17:00 PM
I believe it's just assignment semantics.
Block parameters are set in the same way that an assignment statement is
evaluated, so essentially, it's the same as something like:
x = [["name", "john"], ["age", 20]]
h, (k,v) = {}, x[0]
which does:
h = {}
(k,v) = ["name", "john"] # (k = "name", v = "john")
When assignments involve commas, they're implicitly converted to arrays, so
the above is the same as:
[h, [k, v]] = [{}, x[0]]
which explains why things happen the way they do.
Cheers,
- Dan