gilch / hebigo

蛇語(HEH-bee-go): An indentation-based skin for Hissp.
https://github.com/gilch/hissp
Mozilla Public License 2.0
24 stars 3 forks source link

Implement and test !loop: macro #22

Closed gilch closed 5 years ago

gilch commented 5 years ago

Trampolined loops for TCO recursion, pretty much copied from Drython. (Plus a macro to write the lambda). The loop macro defines a function that can call itself. The initial syntax is similar to def.

!loop: <name>: [<arg> <default>]*
    <body>

Return a call to <name> to recur. See the test for an example.