Hacker News new | ask | show | jobs
by gokr 3648 days ago
Yes, correct. It's worth noting that echo is a prefix function so Spry supports both infix (first argument is on the left) and prefix functions, and if there is a series of keywords the parser will rewrite the keyword call to a prefix/infix call like this:

array at: 1 put: 2 ==> array at:put: 1 2

Thus a keyword call is purely syntactic sugar.

1 comments

And also, the block [echo :x] doesn't use declarations of parameters - instead the ":x" is an operation that pulls in the next argument from the call site and stores it into the local binding x in the closure. Almost Forth-ish, but there is no stack.