RosettaCodeData/Task/Generic-swap/Emacs-Lisp/generic-swap-1.el
2026-04-30 12:34:36 -04:00

6 lines
197 B
EmacsLisp

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