diff options
author | Andy Wingo <wingo@pobox.com> | 2011-12-05 16:37:17 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-12-05 17:49:26 +0100 |
commit | 13dd74c8eae595889df6f570007b5f50b78073ce (patch) | |
tree | 8c24a7a8fc03183313dc34b8d7bb28d0712f468e | |
parent | 90de5c4c2e4fc177c18f6cdd035dad5d8b6895f9 (diff) | |
download | guile-13dd74c8eae595889df6f570007b5f50b78073ce.tar.gz |
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.
-rw-r--r-- | module/ice-9/boot-9.scm | 4 |
1 files changed, 3 insertions, 1 deletions
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 <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) |