Return values from macro

Bug #2035392 reported by mrkissinger
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

When I use "values" to return data, in defun(), it worked as expected. But in defmacro(), it just returned the first value.

$ cat t.lisp
(defun t1 ()
  (values "aaa" "bbb"))

(multiple-value-bind (a b) (t1)
  (format t "~A ~A~%" a b)

(defmacro t2 ()
  (values "ccc" "ddd"))

(multiple-value-bind (c d) (t2)
  (format t "~A ~A~%" c d)
$ sbcl --script t.lisp
aaa bbb
ccc NIL

Revision history for this message
Paul F. Dietz (paul-f-dietz) wrote :

Not a bug. The value of the form (t2) is obtained by expanding the macro and replacing it with the first return value, and then evaluating that.

Changed in sbcl:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.