Re:Not Lisp again (2009)
by Questron on Tuesday May 02, 2017 @03:55PM
(#14249966)
Not really in machine language or even BASIC (see below).
[ Parent
| on HN ]
Your BASIC example doesn't have any local variables to close over. It just references a global. That defeats the whole point of closures.
Passing or returning first-class functions aren't a problem. First-class closures (function pointer + state) are.
You can create closures in CBM BASIC V2 by referencing arrays or creating thunks as an extension. But that's beside the original point. Implementing is not a lot of work but since my mega-deriver already solves the problem (derivation) elegantly and efficiently (most likely more efficiently than the original m68k lisp program), I really don't see any reason to use closures here. Do you?