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 {
	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
|    | Earthlike planets other than our own *do* look like
| ( | Welsh quarries?" --- Coyu, on rasfw, while
+- --+ discussing _Blakes 7_

Attachment: pgpJuAJzd8m1P.pgp
Description: PGP signature