4 ms·
> The most common use of LISP macros is to avoid typing lambda quite so much LispWorks CL-USER 1 > (let ((n-macros 0) (n-with-macros 0) (with-macros nil))
by lispm 10y ago
> The most common use of LISP macros is to avoid typing lambda quite so much
LispWorks
CL-USER 1 > (let ((n-macros 0) (n-with-macros 0) (with-macros nil))
(do-all-symbols (s (values n-macros n-with-macros))
(when (macro-function s)
(incf n-macros)
(let ((name (symbol-name s)))
(when (and name
(> (length name) 4)
(string-equal name "WITH" :start1 0 :end1 4))
(incf n-with-macros)
(push s with-macros))))))
1186 ; macros
182 ; with- macros
Note also that
(with-slots (a b)
foo
(+ a b))
is not the same as:
(call-with-slots foo
'(a b)
(lambda (a b) (+ a b)))