My first Lisp macro; is it leaky?

Posted by Tom Martin on Stack Overflow See other posts from Stack Overflow or by Tom Martin
Published on 2008-09-13T02:04:20Z Indexed on 2010/06/11 16:12 UTC
Read the original article Hit count: 209

Filed under:
|
|

I've been working through Practical Common Lisp and as an exercise decided to write a macro to determine if a number is a multiple of another number:

(defmacro multp (value factor)
`(= (rem ,value ,factor) 0))

so that : (multp 40 10) evaluates to true whilst (multp 40 13) does not

The question is does this macro leak in some way? Also is this "good" Lisp? Is there already an existing function/macro that I could have used?

© Stack Overflow or respective owner

Related posts about best-practices

Related posts about macros