6 ms·
This is from the SBCL source, and I think it's pretty elegant: (defmacro and (&rest forms) (cond ((endp forms) t) ((endp (rest forms))
by wtbob 11y ago
This is from the SBCL source, and I think it's pretty elegant:
(defmacro and (&rest forms)
(cond ((endp forms) t)
((endp (rest forms))
;; Preserve non-toplevelness of the form!
`(the t ,(first forms)))
(t
`(if ,(first forms)
(and ,@(rest forms))
nil))))
- mst 11y agoRight, what's interesting about klisp is that you can define that as something that can be called at runtime, rather than having to be implemented as compile-time macro expansion. I sort of regard operative lisps as "lisp, but even more so", as it were (and for sheer brain melting power when prototyping weird logic they're even more fun than normal lisps, at least to me)
- qwertyuiop924 11y agoI just like them because fexprs are in some ways more elegant and easier to understand than macros.