3 ms·
Totally agree. In my hobby DSL, those inlined childX are syntactic sugar for parent{ children=[child1, child2, child3]}. More generally, I remain uncomfortabl
by specialist 4y ago
Totally agree.
In my hobby DSL, those inlined childX are syntactic sugar for parent{ children=[child1, child2, child3]}.
More generally, I remain uncomfortably undecided about named params (pairs) and indexed params. Esp wrt constructors.
IIRC, I spotted a (hobby?) language that permitted both indexed params (matched in order per method signature) and named params, plus default values. So given "method( int a=10, int b=20)" you could invoke as "method( 1, 2 )", out of order like "method( b: 2, a: 1)" or partially like "method( b: 2 )".
Riffing a bit, this could then allow passing a map of params to a method. Code construction wise, that looks like passing around a context object.
I'll look at Lua again. (It's been a minute.) Thanks.