4 ms·
What are lisp macros for if not to delay evaluation? One class of use cases not covered in the blog post is that a variable appearing as a function's argument
by kd0amg 8y ago
What are lisp macros for if not to delay evaluation?
One class of use cases not covered in the blog post is that a variable appearing as a function's argument can only be a bound occurrence, a use of some name already in scope. A variable appearing as a macro's argument can be the binding occurrence of that name. This is why (using Racket examples) match, define-struct, for/list, and such things aren't functions.
[1]: https://docs.racket-lang.org/reference/match.html?q=match#%28form._%28%28lib._racket%2Fmatch..rkt%29._match%29%29 https://docs.racket-lang.org/reference/match.html?q=match#%2...
[2]: https://docs.racket-lang.org/reference/define-struct.html?q=define-struct#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define-struct%29%29 https://docs.racket-lang.org/reference/define-struct.html?q=...
[3]: https://docs.racket-lang.org/reference/for.html?q=for%2Flist#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for%2Flist%29%29 https://docs.racket-lang.org/reference/for.html?q=for%2Flist...