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:
parent
540cc7abdc
commit
062fccce79
1 changed files with 6 additions and 2 deletions
|
@ -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)))))
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue