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

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

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

Post by thelinx »

Code: Select all

[list]
[*]item
[*]item
[*]item
[/list]
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

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

Post 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
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

Regarding that little script I posted earlier in this thread, it now has a github repo.
User avatar
Jasoco
Inner party member
Posts: 3727
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

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

Post 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.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post by slime »

Jasoco, use bartbes' script... :P
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

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

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

How is that ambiguous, once the line ends the statement ends, right?
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

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

Post 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!
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

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

Post 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
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

Right.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest