lua-users home
lua-l archive

RE: Making vars local by default (completely off topic)

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


>I have always suspected that there was a mechanism for doing this that I was
>missing. How does it work?
The construct 
	xyz { a=10, b=20 }
is the same as
	xyz ({ a=10, b=20 })
that is, the *function* xyz is called with the given table.
This syntactical sugar is the basis of the powerful data description facilities
of Lua. Such statements look declarative but are procedural.
--lhf

AltStyle によって変換されたページ (->オリジナル) /