One Disadvantage to Lua

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
Skofo
Party member
Posts: 146
Joined: Mon Dec 22, 2008 10:55 pm

One Disadvantage to Lua

Post by Skofo »

Image
Last edited by Skofo on Mon Feb 16, 2009 9:42 pm, edited 1 time in total.
Working on: Viator
Need a 64-bit Debian package for LÖVE? Here it is!
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: One Disadvantage to Using Lua

Post by bartbes »

Yeah.. well if you were coding C and you just happened to have */ in your code... that's always the problem with multiline comments, isn't it? Maybe you can just try adding a space?
User avatar
Skofo
Party member
Posts: 146
Joined: Mon Dec 22, 2008 10:55 pm

Re: One Disadvantage to Using Lua

Post by Skofo »

Neat idea, thanks! ^^

I still think that Lua could use something better for multi-line comments, though. Lua seems very table-oriented so it's natural for many double-brackets to be around.
Working on: Viator
Need a 64-bit Debian package for LÖVE? Here it is!
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: One Disadvantage to Lua

Post by mike »

I... did not know that Lua had multi-line comments.

I'm retarded.
Now posting IN STEREO (where available)
User avatar
osgeld
Party member
Posts: 303
Joined: Sun Nov 23, 2008 10:13 pm

Re: One Disadvantage to Lua

Post by osgeld »

you can use [[ and ]] for multi line strings too (well, i haven't tried in love yet so..)
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: One Disadvantage to Lua

Post by Inny »

it's typically better to use the following multi-line comment style in lua, note the use of abitrary but matching equals signs.

Code: Select all

  function lol( rofl )
--[===[
    crash()
]===]
  end
That way you have to match the number of equals signs and have less chance of leaving code accidentally enabled.
User avatar
counterfactual_jones
Prole
Posts: 24
Joined: Mon Feb 09, 2009 10:14 am

Re: One Disadvantage to Lua

Post by counterfactual_jones »

Is it me or does

Code: Select all

--[==[
--]==]
resemble

Code: Select all

B====D~~~
:shock:
User avatar
Skofo
Party member
Posts: 146
Joined: Mon Dec 22, 2008 10:55 pm

Re: One Disadvantage to Lua

Post by Skofo »

Inny wrote:it's typically better to use the following multi-line comment style in lua, note the use of abitrary but matching equals signs.

Code: Select all

  function lol( rofl )
--[===[
    crash()
]===]
  end
That way you have to match the number of equals signs and have less chance of leaving code accidentally enabled.
Oooh, very cool tip. Thank you!
Working on: Viator
Need a 64-bit Debian package for LÖVE? Here it is!
User avatar
Tad2020
Prole
Posts: 9
Joined: Fri Feb 06, 2009 12:00 am

Re: One Disadvantage to Lua

Post by Tad2020 »

Inny wrote:it's typically better to use the following multi-line comment style in lua, note the use of abitrary but matching equals signs.
I have never seen/heard/read about that anywhere in the 3 years I've been using Lua. This is excellent, I like to nest commented blocks sometimes for testing and this will be most useful. Thanks!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest