diff options
author | Andy Wingo <wingo@pobox.com> | 2012-01-25 10:42:54 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2012-01-25 10:42:54 +0100 |
commit | d646d81ec1c9f16a1e4d3f5bd388ec069c47a1c2 (patch) | |
tree | 7e52077a37edf3d5bea8f0fcc5d69a5a79cf2973 | |
parent | c3d5344a92d815c855445d82079d1a390b9282c8 (diff) | |
download | guile-d646d81ec1c9f16a1e4d3f5bd388ec069c47a1c2.tar.gz |
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.
-rw-r--r-- | module/language/tree-il/peval.scm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/module/language/tree-il/peval.scm b/module/language/tree-il/peval.scm index a6bb954e2..abc019904 100644 --- a/module/language/tree-il/peval.scm +++ b/module/language/tree-il/peval.scm @@ -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)))))) |