vendredi 31 juillet 2020

Lisp Macro Multiple Tasks

i have a question about lisp macros. I want to check a condition and if it' true to run a few things not only one. The same for the false way. Can anybody please help??

(defmacro test (condition (&rest then) (&rest else))
  `(if ,condition (progn ,@then) (progn ,@else)))

         (test (= 4 3)
            (print "YES") (print "TRUE")
              (print "NO") (print "FALSE"))

Aucun commentaire:

Enregistrer un commentaire