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:
parent
c3d5344a92
commit
d646d81ec1
1 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
;;; Tree-IL partial evaluator
|
;;; 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
|
;;;; This library is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU Lesser General Public
|
;;;; 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))
|
exp))
|
||||||
(else
|
(else
|
||||||
(let ((vals (map for-value exps)))
|
(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))
|
(every singly-valued-expression? vals))
|
||||||
(for-tail (make-sequence src (append (cdr vals) (list (car vals)))))
|
(for-tail (make-sequence src (append (cdr vals) (list (car vals)))))
|
||||||
(make-application src (make-primitive-ref #f 'values) vals))))))
|
(make-application src (make-primitive-ref #f 'values) vals))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue