lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Eric Scouten wrote:
[...]
>   tableWithMeaningfulName[] = value

I have to say that I don't like this, simply because the syntax doesn't convey
any information about what it does --- if anything, it looks like it should
assign to *all* members of the table. I'd rather have the language consistent
and verbose rather than concise and full of special exceptions. That way lies
madness, e.g. Perl.

(It is for this reason that I particularly dislike the way that the last
parameter in table initialisers and function calls is handled specially. I can
see why it has to do that, from an implementation point of view, but that
doesn't mean I like it.)

If:

tableWithMeaningfulName[#tableWithMeaningfulName + 1] = value

...is too long, then what's wrong with:

t=tableWithMeaningfulName t[#t+1] = value

...? It's only seven characters longer than the proposed extension, and
doesn't involve any language modifications.

-- 
+- David Given --McQ-+ "Gaping from its single obling socket was
|  dg@cowlark.com    | scintillating, many fauceted scarlet emerald..."
| (dg@tao-group.com) | --- Jim Theis, _The Eye of Argon_ (spelling
+- www.cowlark.com --+ original)


Attachment: signature.asc
Description: OpenPGP digital signature