lua-users home
lua-l archive

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


Hi,

On Sun, Dec 01, 2013 at 01:21:41PM -0500, Marc Lepage wrote:
[...]
> ----- BEGIN MODULE -----
> tree = node { node {}, node { node {} } }
> ----- END MODULE -----
> 
> So far so good, that is semantically what I want. But I'd like to make the
> syntax simpler, something like:
> 
> ----- BEGIN MODULE -----
> node {}
> node { node {} }
> ----- END MODULE -----
> 
> where the root level mod.tree node is implicitly made, and the top level
> nodes in the module implicitly add themselves as children to the root level
> node.

You could have all nodes add themselves to the top level, but also have
them remove their children from it.

Chris