News for hackers. Stuff that matters.
Re:Show HN: Lapis – A web framework for MoonScript and OpenR... by pygy_ on Wednesday April 24, 2013 @07:44PM (#5604766)
`.` and `\` in Moonscript map to `.` and `:` in Lua.

In Lua, `foo.bar` is just syntactic sugar for `foo["bar"]`, a table lookup with a string key.

In turn, `foo:bar(baz)` is syntactic sugar for `foo.bar(foo, baz)`.

It is not uncommon to mix things up, and put a dot instead of the column. IIRC, Leafo used the backslash instead because it is more distinct, visually.

    Users\create name: @params.username
is thus equivalent to

    Users.create( Users, name: @params.username )
(adding parens for maximum clarity).

There are no comments on this comment yet.