I was thinking about what the hello-world of Lisp macros is. It might be something like (mac hello (x) `(set ,x t)) This takes one argument and sets it to t. > (hello foo) t > foo t
Can you give an example where you use this macro to write something that would be inconvenient to write without it?
-
-
Not sure atm but I'll look for one. At least that can’t be done with a function, right? I totally forgot about the inconvenience part. This insight came from combining the (+) and ,@ in pages 8 & 164 of your book, (format) only came up later when considering the hello-world macro
-
It seems like it can be done with nothing at all, in the sense that e.g. (pass-args (f g) h i j) could always simply be written as (f g h i j)
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.