Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#597 (setf (values (values) b c) (...)) misplaces values

closed-fixed
Sam Steingold
clisp (525)
5
2011-04-22
2011-04-22
belovedeagle
No

Clisp 2.48 gives:
(setf (values (values) b c) (values 'x 'y 'z)) => nil; x; y
b => x
c => y
but should be:
(setf ...) => nil; y; z
b => y
c => z

(macroexpand '(setf (values (values) b c) form)) should be roughly the same as (macroexpand '(setf (values (values a) b c) form)) but clisp fails to include a (pop #:values-0000) for the first value place in the former situation:
[9]> (macroexpand '(setf (values (values) b c) form))
(LET*
((#:VALUES-2935 (MULTIPLE-VALUE-LIST FORM)) (#:NEW-2933 (POP #:VALUES-2935))
(#:NEW-2934 (POP #:VALUES-2935)))
(VALUES (VALUES) (SETQ B #:NEW-2933) (SETQ C #:NEW-2934))) ;
T
[10]> (macroexpand '(setf (values (values a) b c) form))
(LET*
((#:VALUES-2939 (MULTIPLE-VALUE-LIST FORM)) (#:NEW-2936 (POP #:VALUES-2939))
(#:NEW-2937 (POP #:VALUES-2939)) (#:NEW-2938 (POP #:VALUES-2939)))
(VALUES (VALUES (SETQ A #:NEW-2936)) (SETQ B #:NEW-2937) (SETQ C #:NEW-2938))) ;
T

Discussion

  • Sam Steingold
    Sam Steingold
    2011-04-22

    thank you for your bug report.
    the bug has been fixed in the source tree (mercurial/hg).
    you can either wait for the next release (recommended)
    or check out the current mercurial tree (see http://clisp.org\)
    and build CLISP from the sources (be advised that between
    releases the source tree is very unstable and may not even build
    on your platform).

     
  • Sam Steingold
    Sam Steingold
    2011-04-22

    • assigned_to: haible --> sds
    • status: open --> closed-fixed
     
  • Sam Steingold
    Sam Steingold
    2011-04-22

    note that macroexpand-1 is more instructive in this case...