~ chicken-core (chicken-5) ac843dd5da8f41ba1fabd4d2ad7ba80b0adbf984
commit ac843dd5da8f41ba1fabd4d2ad7ba80b0adbf984 Author: felix <felix@call-with-current-continuation.org> AuthorDate: Sun Jul 31 14:07:22 2011 +0200 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Sun Jul 31 14:07:22 2011 +0200 parameter-assignments returns the new value diff --git a/library.scm b/library.scm index 8d605849..0abf2dfa 100644 --- a/library.scm +++ b/library.scm @@ -2203,8 +2203,9 @@ EOF (when (fx>= i n) (set! ##sys#current-parameter-vector (##sys#grow-vector ##sys#current-parameter-vector (fx+ i 1) ##sys#snafu) ) ) - (##sys#setslot ##sys#current-parameter-vector i (guard val)) - (##core#undefined) ))) + (let ((val (guard val))) + (##sys#setslot ##sys#current-parameter-vector i val) + val)))) (getter-with-setter (lambda arg (let ((n (##sys#size ##sys#current-parameter-vector))) diff --git a/manual/Parameters b/manual/Parameters index 2d9b22ca..e5b17421 100644 --- a/manual/Parameters +++ b/manual/Parameters @@ -22,7 +22,6 @@ owns a local copy of a parameters' value. CHICKEN implements [[http://srfi.schemers.org/srfi-39/srfi-39.html|SRFI-39]]. - === make-parameter <procedure>(make-parameter VALUE [GUARD])</procedure> @@ -30,11 +29,12 @@ CHICKEN implements [[http://srfi.schemers.org/srfi-39/srfi-39.html|SRFI-39]]. Returns a procedure that accepts zero or one argument. Invoking the procedure with zero arguments returns {{VALUE}}. Invoking the procedure with one argument changes its value to the value of that -argument (subsequent invocations with zero parameters return the new -value). {{GUARD}} should be a procedure of a single argument. Any -new values of the parameter (even the initial value) are passed to this -procedure. The guard procedure should check the value and/or convert it -to an appropriate form. +argument and returns the new value (subsequent invocations with zero +parameters return the new value). {{GUARD}} should be a procedure of a +single argument. Any new values of the parameter (even the initial +value) are passed to this procedure. The guard procedure should check +the value and/or convert it to an appropriate form. + == Built-in parametersTrap