doc corrections/clarifications for 'when' and 'lambda'
svn: r10674
This commit is contained in:
parent
d3e15c3ba9
commit
bdbcd1a56c
|
@ -988,9 +988,12 @@ as follows:
|
||||||
list that is associated to @scheme[rest-id].}
|
list that is associated to @scheme[rest-id].}
|
||||||
|
|
||||||
The @scheme[kw-formals] identifiers are bound in the
|
The @scheme[kw-formals] identifiers are bound in the
|
||||||
@scheme[body]s. When the procedure is applied, a new location is
|
@scheme[body]s. When the procedure is applied, a new @tech{location}
|
||||||
created for each identifier, and the location is filled with the
|
is created for each identifier, and the location is filled with the
|
||||||
associated argument value.
|
associated argument value. The @tech{locations} are created and filled
|
||||||
|
in order, with @scheme[_default-expr]s evaluated as needed to fill
|
||||||
|
locations. @margin-note{In other words, argument bindings with
|
||||||
|
default-value expressions are evaluated analogous to @scheme[let*].}
|
||||||
|
|
||||||
If any identifier appears in the @scheme[body]s that is not one of the
|
If any identifier appears in the @scheme[body]s that is not one of the
|
||||||
identifiers in @scheme[kw-formals], then it refers to the same
|
identifiers in @scheme[kw-formals], then it refers to the same
|
||||||
|
@ -1638,9 +1641,10 @@ classifications:
|
||||||
|
|
||||||
@defform[(when test-expr expr ...)]{
|
@defform[(when test-expr expr ...)]{
|
||||||
|
|
||||||
Evaluates the @scheme[text-expr]. If the result is any value other
|
Evaluates the @scheme[text-expr]. If the result is @scheme[#f], then
|
||||||
than @scheme[#f], the @scheme[expr]s are evaluated, and the results
|
the result of the @scheme[when] expression is
|
||||||
are ignored. No @scheme[expr] is in tail position with respect to the
|
@|void-const|. Otherwise, the @scheme[expr]s are evaluated, and the
|
||||||
|
last @scheme[expr] is in tail position with respect to the
|
||||||
@scheme[when] form.
|
@scheme[when] form.
|
||||||
|
|
||||||
@examples[
|
@examples[
|
||||||
|
|
|
@ -1096,5 +1096,39 @@
|
||||||
|
|
||||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
;; Check that locations for lambda arguments are created
|
||||||
|
;; one-by-one --- like `let*', and not like `letrec':
|
||||||
|
|
||||||
|
(test '((1 10) (x1 10) (x2 z1))
|
||||||
|
'lambda-loc
|
||||||
|
(let ()
|
||||||
|
(define procs null)
|
||||||
|
(define again #f)
|
||||||
|
|
||||||
|
(define (f x
|
||||||
|
[y (let/cc k
|
||||||
|
(unless again
|
||||||
|
(set! again k))
|
||||||
|
(lambda () 'done))]
|
||||||
|
[z 10])
|
||||||
|
(set! procs
|
||||||
|
(cons (lambda (xv zv)
|
||||||
|
(begin0
|
||||||
|
(list x z)
|
||||||
|
(set! x xv)
|
||||||
|
(set! z zv)))
|
||||||
|
procs))
|
||||||
|
(y))
|
||||||
|
|
||||||
|
(f 1)
|
||||||
|
(let/cc esc (again esc))
|
||||||
|
|
||||||
|
(list
|
||||||
|
((cadr procs) 'x1 'z1)
|
||||||
|
((car procs) 'x2 'z2)
|
||||||
|
((cadr procs) 'x10 'z10))))
|
||||||
|
|
||||||
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(report-errs)
|
(report-errs)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user