Let's see if we can make it work.
func (n)to(m)do(blk) could be syntactic sugar for to:do: funci (n, m, blk). I saw funci in the examples, I didn't investigate if there are other type of function definitions. However, if the definition starts with (arg) it should be easy to map it into a funci. This either solves the problem of name clashes with other libraries, or the problem is unsolved right now.
The block passing is more serious. Maybe we could mark blk in such a way we know it's a block. Ruby uses & as in
func (n)to(m)do(&blk)
Maybe Spry uses & in an incompatible way and I don't like it much anyway. It's developers bending to the compiler, but let's be realistic: we don't want slow compilers.What Ruby also does is having a yield keyword that calls an anonymous block passed at the invocation point of the function (a method in Ruby's world). The block is not declared as argument of the function/method. Maybe:
func (n)to(m)do() { # an empty arg is a block
x = n
...
do x
...
}
1 to 5 do { echo x }
But I think this is getting far away from the way of Spry. {1 to 5 (echo x)}
... which would read into: (loop for x from 1 upto 5 do (echo x))
Note that binding `x` implicitly is bad style, as well as defining terse syntax for every construct.So it's a kind of quoting. I haven't pushed these things further yet, and frankly I am not that heavily into macros unless they are really needed. But obviously AST manipulation is easy in Spry.