[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Thoughts on optional commas
- From: Wesley Smith <wesley.hoke@...>
- Date: Mon, 5 Mar 2012 00:15:35 -0800
On Mon, Mar 5, 2012 at 12:07 AM, Eric Wing <ewmailing@gmail.com> wrote:
> I'm going to stick up for Greg and agree with him on both these points:
> - Commas are generally the more common case
> - Consistency is better than compromise (i.e. applying only to
> associative arrays only vs. arrays is a bad idea). (I would say this
> compromise would not be worth doing at all.)
>
> As an aside, I never cared much for the current inconsistency in the
> rules of omitting parenthesis.
>
> -- Valid
> print "foo"
> print { }
>
> -- Error
> print 2
I don't see print 2 as an inconsistency. Lua doesn't account for
whitespace in it's grammar, which is what print 2 would need since
print2 is an identifier where as print"2" is clearly an identifier
with a string.
wes