1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 19:50:24 +02:00

add another case in which to fold (values FOO) to FOO, for some FOO

* module/language/tree-il/peval.scm (peval): Fold (values
  'singly-valued-expression) to 'singly-valued-expression in contexts
  that expect multiple values, in addition to those that expect single
  values.
This commit is contained in:
Andy Wingo 2012-01-25 10:42:54 +01:00
parent c3d5344a92
commit d646d81ec1

View file

@ -1,6 +1,6 @@
;;; Tree-IL partial evaluator
;; Copyright (C) 2011 Free Software Foundation, Inc.
;; Copyright (C) 2011, 2012 Free Software Foundation, Inc.
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@ -1011,7 +1011,9 @@ top-level bindings from ENV and return the resulting expression."
exp))
(else
(let ((vals (map for-value exps)))
(if (and (memq ctx '(value test effect))
(if (and (case ctx
((value test effect) #t)
(else (null? (cdr vals))))
(every singly-valued-expression? vals))
(for-tail (make-sequence src (append (cdr vals) (list (car vals)))))
(make-application src (make-primitive-ref #f 'values) vals))))))