Is it possible to assign multiple return values directly to variables without going through a temporary variable in Emacs Lisp?
For example, let's say I have a function that returns a list of two lists:
(defun test-func ()
(setq a '(a b))
(setq b '(c d))
`(,a ,b))
If I want to assign the first return value to list-a
and the second return value to list-b
, I can do this by using a temporary variable temp
, for example:
(let* ((temp (test-func)) (list-a (car temp)) (list-b (cadr temp)))
(message-box (prin1-to-string list-a))
(message-box (prin1-to-string list-b)))
Is it possible to do this more simply? (I am used to Perl and Python where you do not have to specify a temporary variable)