1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-31 17:30:24 +02:00

(with-fluids): Use with-fluid* when only one fluid is being set.

This commit is contained in:
Marius Vollmer 2004-01-07 19:51:07 +00:00
parent 540cc7abdc
commit 062fccce79

View file

@ -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)))))