Re:Szl, a Tcl-inspired embeddable language
by nowayyeah on Saturday October 08, 2016 @12:47PM
(#12667574)
Then why the $, you already know that it's an object.
[ Parent
| on HN ]
Re:Szl, a Tcl-inspired embeddable language
by dimkr1 on Saturday October 08, 2016 @12:51PM
(#12667590)
Nope. The first token in a statement is treated the same way as those that come after it. This way, you can do stuff like this (i.e. imagine a dictionary that maps HTTP methods to hander functions):
>>> $local functions [$list.new $puts $sleep]
puts sleep
>>> [$list.index $functions 0] hello
helloI think it might be better to special case the first word in the command, just like sh and tcl do. The list.index case you mentioned is much rarer than just calling a command directly.