RosettaCodeData/Task/Generic-swap/Emacs-Lisp/generic-swap-1.l
2023-07-01 13:44:08 -04:00

6 lines
197 B
Common Lisp

(defun swap (a-sym b-sym)
"Swap values of the variables given by A-SYM and B-SYM."
(let ((a-val (symbol-value a-sym)))
(set a-sym (symbol-value b-sym))
(set b-sym a-val)))
(swap 'a 'b)