This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

writing a macro script

3 posts · 2125 views

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.
> (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
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

Re: writing a macro script

You are using quote instead of backquote. Tbh its impossible to help you because your code doesn't make any sense.