I am trying to define a macro in LISP, such as this caller function in a different file
(set_name name My name is Timmy)
(set_name occupation I am a doctor )
(defmacro set_name (list)
(print list)
)
I am trying to define a macro in LISP, such as this caller function in a different file
(set_name name My name is Timmy)
(set_name occupation I am a doctor )
(defmacro set_name (list)
(print list)
)
Just like in ordinary functions, use &rest to collect all the remaining arguments into a list.
(defmacro set_name (name &rest list)
`(setq ,name ',list))
(set_name occupation I am a doctor)
(print occupation)
This will print (I AM A DOCTOR)
You need to quote ,list in the expansion so it won't try to evaluate all the symbols as variables.