lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wednesday 01 March 2006 23:17, David Manura wrote:
[...]
> But similarly, I don't fully see why Lua allows parenthesis to be omitted
> for string literals.  My guess is that it might be used for some syntactic
> sugar as the Pythonic r"hello", treating r as some function that modifies
> the string literal.

It is indeed syntactic sugar, stemming back from Lua's origins as a 
configuration language. It allows you do do such things as:

thing {
	parameter1,
	parameter2,
	parameter3 "fnord!",
	parameter4 { frobnicate = true}
}

This can be amazingly handy (I'm using this in two seperate places).

-- 
+- David Given --McQ-+ "I've just had a terrible thought --- what if all
|  dg@cowlark.com    | Earthlike planets other than our own *do* look like
| (dg@tao-group.com) | Welsh quarries?" --- Coyu, on rasfw, while
+- www.cowlark.com --+ discussing _Blakes 7_

Attachment: pgpwX2AqVZNLe.pgp
Description: PGP signature