5 ms·
How about syntactic extensions: (defmacro unless (test &body body) `(if (not ,test) ,@body))
by typedweb 11y ago
How about syntactic extensions:
(defmacro unless (test &body body)
`(if (not ,test) ,@body))
- cosarara97 11y agoThat's a theoretical problem, not a real world problem.
- typedweb 11y agoI'm not quite sure how being able to extend syntax is a theoretical problem. It was just a basic example for brevity. There are many more examples of macros that solve real world problems, such as writing a compiler for an embedded DSL that is tuned to solving your real problem that allows expressivity and brevity that you would never see without the use of macros.