writing a macro script
Posted: Sun Sep 18, 2011 8:50 pm
i am new to lisp and programming in general i have been going through commands as i come upon them while reading structure and interpretation of computer programs. the book is odd and it explains things well but when talking about lisp it doesn't give the actual code for lisp commands. i am trying to write a macro which i am lead to believe will make it so that i can define a list and connect it to a variable rather than typing the entire list over and over.
this is what i get as an error message but when i tried moving the back quote around it didn't accept it. thank you for any help
Code: Select all
> (defmacro lambda-vars
((lambda (a b c) (+ a b c)) 1 (* 2 3) (- 5 4))
'(cadr, ((lambda (a b c) (+ a b c)) 1 (* 2 3) (- 5 4))))
> Error: Reader error on #<CCL::RECORDING-CHARACTER-INPUT-STREAM #x302000F1FFCD>, near position 78:
> Comma not inside backquote