logoalt Hacker News

binary132 • today at 4:43 AM • 1 reply • view on HN

It’s also pretty nice that a verb plus a table is implicitly a function call. This means you can easily do things that seem to be types:

  m = Menagerie {
    Dog { tail, ears, snout=long },
    Cat { you, get, the=idea },
    table.unpack(ark),
  }

Replies

sudahtigabulan • today at 7:00 AM

This syntax is inherited from one of Lua's predecessors, Sol, for compatibility, and in Sol, it actually means types!

There are a couple of snippets here that refer to it (search for @track):

https://www.lua.org/history.html