lua-users home
lua-l archive

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


On Thu, Dec 17, 2015 at 3:25 PM, Thijs Schreijer
<thijs@thijsschreijer.nl> wrote:
> I ran into the following;
>
> local v = {type = "timestamp"}                          -- added to run it
> if v.type == "number" or v .type == "timestamp" then    -- actual code
> end
>
>
>
> Notice above, the second `v.type` has a typo with an extra space; `v .type`. I'd expected an error, but it runs fine.
>
> Why?
>
> Thijs


Why not? . is more or less a binary operator and follows the syntax
rules for one.

/s/ Adam