After some trial & error, I've managed to code a macro mashup to print the names & values of several variables (for debugging). It seems to work, but I'd like to see how to code this more "professionally"?
(defmacro prt1 (var) ;Print a single variable and its value. `(progn (princ (symbol-name ',var)) (princ " = ") (princ ,var) (terpri))) (defmacro prt (&rest vars) ;Print the values of a number of variable names. (eval `(append (list 'progn) (map 'list #'(lambda (x) (list 'prt1 x)) ',vars) (list (list 'terpri)) (list t)))) ;need to return t Calling (prt A B C) then prints the current bindings--eg:
A = 1 B = 2 C = 3 T