From 062fccce799bd874bcab541a8641682f85a06135 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Wed, 7 Jan 2004 19:51:07 +0000 Subject: [PATCH] (with-fluids): Use with-fluid* when only one fluid is being set. --- ice-9/boot-9.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index f41420006..0cc341a19 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -2626,8 +2626,12 @@ ;; body) (defmacro with-fluids (bindings . body) - `(with-fluids* (list ,@(map car bindings)) (list ,@(map cadr bindings)) - (lambda () ,@body))) + (let ((fluids (map car bindings)) + (values (map cadr bindings))) + (if (and (= (length fluids) 1) (= (length values) 1)) + `(with-fluid* ,(car fluids) ,(car values) (lambda () ,@body)) + `(with-fluids* (list ,@fluids) (list ,@values) + (lambda () ,@body)))))