Re:Lisp Macros, Delayed Evaluation and the Evolution of Smal...
by skybrian on Wednesday March 20, 2019 @02:17AM
(#19439508)
Okay, but if you have macros, you might as well use them. The idea is more about exploring what can be done when designing a less powerful language, without macros.
Re:Lisp Macros, Delayed Evaluation and the Evolution of Smal...
by lispm on Wednesday March 20, 2019 @02:43AM
(#19439617)
> The idea is more about exploring what can be done when designing a less powerful language, without macros.
Lot's of things. But the language won't be able to easily compute code at compile time, which a main purpose of macros. Lisp has a simple data format for source code and thus code transformations are relatively simple to do and even integrated into the language.
But Lisp does not go the route of making IF a function, because it typically provides three different types of language expressions and IF then is a special operator:
1) function calls
2) macro forms
3) a small set of special operators, which are implemented as built-in functionality. One of them is a core conditional operator. More complex conditional operators then are implemented as macros, which expand eventually into the core conditional operator. The interpreter and compiler will have to specially recognize and implement these special operators.
See IF: http://clhs.lisp.se/Body/s_if.htm
The usual Lisp view is that
is no useful improvement over Some disagree, but most of the time the pattern is preferred in Lisp over