fix guide typos
svn: r10862
This commit is contained in:
parent
0f984fbc02
commit
2e7047b87f
|
@ -43,7 +43,7 @@ sometimes said to have an @defterm{implicit begin}.
|
||||||
@defexamples[
|
@defexamples[
|
||||||
(define (print-triangle height)
|
(define (print-triangle height)
|
||||||
(cond
|
(cond
|
||||||
[(not (positive? height))
|
[(positive? height)
|
||||||
(display (make-string height #\*))
|
(display (make-string height #\*))
|
||||||
(newline)
|
(newline)
|
||||||
(print-triangle (sub1 height))]))
|
(print-triangle (sub1 height))]))
|
||||||
|
|
|
@ -15,7 +15,7 @@ of an expression to the values for the clause:
|
||||||
|
|
||||||
Each @scheme[_datum] will be compared to the result of the first
|
Each @scheme[_datum] will be compared to the result of the first
|
||||||
@scheme[_expr] using @scheme[eqv?]. Since @scheme[eqv?] doesn't work on
|
@scheme[_expr] using @scheme[eqv?]. Since @scheme[eqv?] doesn't work on
|
||||||
many kinds of values, notably symbols and lists, each @scheme[_datum]
|
many kinds of values, notably strings and lists, each @scheme[_datum]
|
||||||
is typically a number, symbol, or boolean.
|
is typically a number, symbol, or boolean.
|
||||||
|
|
||||||
Multiple @scheme[_datum]s can be supplied for each clause, and the
|
Multiple @scheme[_datum]s can be supplied for each clause, and the
|
||||||
|
|
|
@ -62,15 +62,15 @@ the answer.
|
||||||
|
|
||||||
@specform[(and expr ...)]
|
@specform[(and expr ...)]
|
||||||
|
|
||||||
An @scheme[or] form produces @scheme[#f] if any of its @scheme[expr]s
|
An @scheme[and] form produces @scheme[#f] if any of its @scheme[_expr]s
|
||||||
produces @scheme[#f]. Otherwise, it produces the value of its last
|
produces @scheme[#f]. Otherwise, it produces the value of its last
|
||||||
@scheme[_expr]. As a special case, @scheme[(and)] produces
|
@scheme[_expr]. As a special case, @scheme[(and)] produces
|
||||||
@scheme[#t].
|
@scheme[#t].
|
||||||
|
|
||||||
@specform[(or expr ...)]
|
@specform[(or expr ...)]
|
||||||
|
|
||||||
The @scheme[and] form produces @scheme[#f] if any of its
|
The @scheme[or] form produces @scheme[#f] if all of its
|
||||||
@scheme[_expr]s produces @scheme[#f]. Otherwise, it produces the first
|
@scheme[_expr]s produce @scheme[#f]. Otherwise, it produces the first
|
||||||
non-@scheme[#f] value from its @scheme[expr]s. As a special case,
|
non-@scheme[#f] value from its @scheme[expr]s. As a special case,
|
||||||
@scheme[(or)] produces @scheme[#f].
|
@scheme[(or)] produces @scheme[#f].
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ non-@scheme[#f] value from its @scheme[expr]s. As a special case,
|
||||||
If evaluation reaches the last @scheme[_expr] of an @scheme[and] or
|
If evaluation reaches the last @scheme[_expr] of an @scheme[and] or
|
||||||
@scheme[or] form, then the @scheme[_expr]'s value directly determines
|
@scheme[or] form, then the @scheme[_expr]'s value directly determines
|
||||||
the @scheme[and] or @scheme[or] result. Therefore, the last
|
the @scheme[and] or @scheme[or] result. Therefore, the last
|
||||||
@scheme[expr] is in tail position, which means that the above
|
@scheme[_expr] is in tail position, which means that the above
|
||||||
@scheme[got-milk?] function runs in constant space.
|
@scheme[got-milk?] function runs in constant space.
|
||||||
|
|
||||||
@guideother{@secref["tail-recursion"] introduces tail calls and tail positions.}
|
@guideother{@secref["tail-recursion"] introduces tail calls and tail positions.}
|
||||||
|
|
|
@ -99,7 +99,7 @@ extra first argument. Also, a starting ``current'' value must be
|
||||||
provided before the lists:
|
provided before the lists:
|
||||||
|
|
||||||
@interaction[
|
@interaction[
|
||||||
(foldl (lambda (v elem)
|
(foldl (lambda (elem v)
|
||||||
(+ v (* elem elem)))
|
(+ v (* elem elem)))
|
||||||
0
|
0
|
||||||
'(1 2 3))
|
'(1 2 3))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user