lua-users home
lua-l archive

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


On 8 July 2013 05:33, Rob Hoelz <rob@hoelz.ro> wrote:
> On Sun, 7 Jul 2013 22:25:41 +0300
> Aggelos Kolaitis <neoaggelos@gmail.com> wrote:
>
>> I'm sorry if this has been answered recently, but I have a kind of
>> rookie question to make
>>
>> What does '3D' means when used with '=' ?
>>
>> If I recall correctly, I've recently seen this syntax:
>> >
>> > var =3D somevalue
>> >
>>
>> How does that differ from
>> >
>> > var = somevalue
>> >
>> and which syntax is better / more commonly used?
>>
>> Thanks in advance,
>> Aggelos Kolaitis
>
> That's not actually valid Lua syntax; I think you may have issues with
> your mail client, as =3D is used to represent the character '='.
>
> -Rob

The one exception to this is if `3D` is followed by a single string or
table literal, in which case Lua would attempt to call `3D` (which
should be a function or something with a __call metamethod) and assign
its first return value to `var`. `3D` is not special in any way, Lua
does this for any variable name followed by a literal.

Read more about this here:
http://www.lua.org/manual/5.1/manual.html#2.5.8
http://www.lua.org/manual/5.2/manual.html#3.4.9