[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Thoughts on optional commas
- From: Axel Kittenberger <axkibe@...>
- Date: Mon, 5 Mar 2012 13:14:00 +0100
> But to keep the discussion going:
> I know that we just removed a special newline rule for Lua 5.2, but maybe
> commas in tables could be made optional if the elements are followed by a
> newline ...? That seems to be the most common use case in the given
> examples.
Indeed this is the case it makes any sense. However, I wonder if this
semi-significance of newline is more a new abscess rather than a
patch.
Consider following function in Javascript, what do you guess it returns?
function test() {
return
[1,
2];
}
If you said [1, 2] you are wrong, it returns undefined. Only sense it
makes is when you go Coffescript/MoonScript/Phyton and make it full
significant including signifance of white space. Then
a = [
afunc
"muh"
]
is obviously an array with two items, a function point to print and
the String "muh" while
a = [
afunc
"muh"
]
is obviously an array with one item, the result of afunc("muh")
Go this way, or go that way, but don't half-ass things :-)