From 13dd74c8eae595889df6f570007b5f50b78073ce Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 5 Dec 2011 16:37:17 +0100 Subject: [PATCH] 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. --- module/ice-9/boot-9.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm index 73d897c41..47f0ead60 100644 --- a/module/ice-9/boot-9.scm +++ b/module/ice-9/boot-9.scm @@ -2872,7 +2872,9 @@ module '(ice-9 q) '(make-q q-length))}." (make-struct 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)