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