Page 4 of 6

Re: The "I Love Lua, but..." post

Posted: Sun May 01, 2011 5:16 pm
by thelinx

Code: Select all

[list]
[*]item
[*]item
[*]item
[/list]

Re: The "I Love Lua, but..." post

Posted: Sun May 01, 2011 5:35 pm
by vrld
ishkabible wrote:*no control over for loops, sometimes i want a different condition than <= or a more complex increment than addition
Uhm.. what? Generic for.
ishkabible wrote:*arrays start at 1, WTF!! they should start at 0!!
Says who? :P

Re: The "I Love Lua, but..." post

Posted: Sun May 01, 2011 5:38 pm
by bartbes
Regarding that little script I posted earlier in this thread, it now has a github repo.

Re: The "I Love Lua, but..." post

Posted: Sun May 01, 2011 6:11 pm
by Jasoco
Not everyone uses an editor that has text replacing you know. Not everyone WANTS to switch editors from something they like to something that isn't good enough just for that feature. Give me my gosh darn ++ and += and != consarnit!

No, not really a big deal. I've become used to typing it all out.

Re: The "I Love Lua, but..." post

Posted: Sun May 01, 2011 6:34 pm
by slime
Jasoco, use bartbes' script... :P

Re: The "I Love Lua, but..." post

Posted: Sun May 01, 2011 8:30 pm
by Xgoff
Robin wrote:
BlackBulletIV wrote:The main problem now I guess, is that they have to maintain backwards compatibility with grammar.
No, it's that it would allow ambiguous syntax. In which case it's not at all obvious what the compiler should do. These situations cause debugging to be very hard, because the code doesn't look wrong, and there is probably not even an error at that exact location.
it turns out that lua already has an ambiguous syntax case that's related to that if example:

Code: Select all

local x = y
(z or print)("hello")
it's better not having more of them! (although this case is technically fixed in 5.2, since it'll just assume it's all one statement)

also, if x++ were added, then people would expect x-- to be added too. but... there's a problem with the latter one.

Re: The "I Love Lua, but..." post

Posted: Sun May 01, 2011 8:33 pm
by bartbes
How is that ambiguous, once the line ends the statement ends, right?

Re: The "I Love Lua, but..." post

Posted: Sun May 01, 2011 8:40 pm
by thelinx
bartbes wrote:How is that ambiguous, once the line ends the statement ends, right?
No. Take this, for example:

Code: Select all

foobar = table.concat
{
  "foo",
  "bar"
} -- works!

Re: The "I Love Lua, but..." post

Posted: Sun May 01, 2011 8:44 pm
by Xgoff
bartbes wrote:How is that ambiguous, once the line ends the statement ends, right?
line breaks aren't considered significant in lua's syntax

Re: The "I Love Lua, but..." post

Posted: Sun May 01, 2011 8:47 pm
by bartbes
Right.