1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 05:30:21 +02:00

setting a parameter returns the previous value

* module/ice-9/boot-9.scm (make-parameter): Setting a parameter by
  invoking it with an argument now returns the previous value.
This commit is contained in:
Andy Wingo 2011-12-05 16:37:17 +01:00
parent 90de5c4c2e
commit 13dd74c8ea

View file

@ -2872,7 +2872,9 @@ module '(ice-9 q) '(make-q q-length))}."
(make-struct <parameter> 0
(case-lambda
(() (fluid-ref fluid))
((x) (fluid-set! fluid (conv x))))
((x) (let ((prev (fluid-ref fluid)))
(fluid-set! fluid (conv x))
prev)))
fluid conv)))
(define (parameter? x)