I worked through Practical General Lisp , and as an exercise, it was decided to write a macro to determine if a number is several other numbers:
(defmacro multp (value factor)`(= (rem ,value ,factor) 0))
so that: (multp 40 10) evaluates to true while (multp 40 13) not
(multp 40 10)
(multp 40 13)
The question is, how is this macro leak ? Also this "good" Lisp? Is there an existing function / macro that I could use?
Siebel ( ) , . value, factor , rem .
value
factor
rem
Lisp, .
(defun multp (value factor) (zerop (rem value factor)))
. ( zerop. , , , , - , - , , (= ... 0) )
zerop
(= ... 0)
. , , - gensyms. "" Lisp, , , , . , , .
, , :
(flet ((= (&rest args) nil)) (multp 40 10))
NIL... , ANSI CL , CL: =, .
, , ( , ), ( ).
, , , " " .
, , . , , , , , :
(defmacro ana-and (&rest forms) (loop for form in (reverse forms) for completion = form then `(let ((it ,form)) (when it ,completion)) finally (return completion)))
" " , , , ( , NIL). , , cobbled-together-, , .