From d646d81ec1c9f16a1e4d3f5bd388ec069c47a1c2 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Wed, 25 Jan 2012 10:42:54 +0100 Subject: [PATCH] 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. --- module/language/tree-il/peval.scm | 6 ++++-- 1 file 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))))))