how do I define this conditional inside a defmacro?
Posted: Mon May 05, 2014 2:14 am
When I run this macro as `(bool :true)` I get:
The function COMMON-LISP:T is undefined.
How do I change this macro so I can run `(bool :true)` and get `1` without really changing anything else about that's not necessary. As a defun, the below works btw. Thanks in advance for any help on this:)
The function COMMON-LISP:T is undefined.
How do I change this macro so I can run `(bool :true)` and get `1` without really changing anything else about that's not necessary. As a defun, the below works btw. Thanks in advance for any help on this:)
Code: Select all
(defmacro bool (&rest args)
` (cond ((eq (first ,args) nil) (princ nil))
((eq :true (first ,args)) (princ 1))
(t nil)))