diff --git a/collects/scribblings/guide/begin.scrbl b/collects/scribblings/guide/begin.scrbl index 5e22f63d13..7efeb531cf 100644 --- a/collects/scribblings/guide/begin.scrbl +++ b/collects/scribblings/guide/begin.scrbl @@ -43,7 +43,7 @@ sometimes said to have an @defterm{implicit begin}. @defexamples[ (define (print-triangle height) (cond - [(not (positive? height)) + [(positive? height) (display (make-string height #\*)) (newline) (print-triangle (sub1 height))])) diff --git a/collects/scribblings/guide/case.scrbl b/collects/scribblings/guide/case.scrbl index 037b8dfc61..f38d4dd149 100644 --- a/collects/scribblings/guide/case.scrbl +++ b/collects/scribblings/guide/case.scrbl @@ -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 @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. Multiple @scheme[_datum]s can be supplied for each clause, and the diff --git a/collects/scribblings/guide/cond.scrbl b/collects/scribblings/guide/cond.scrbl index bd31589068..35edb479cd 100644 --- a/collects/scribblings/guide/cond.scrbl +++ b/collects/scribblings/guide/cond.scrbl @@ -62,15 +62,15 @@ the answer. @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 @scheme[_expr]. As a special case, @scheme[(and)] produces @scheme[#t]. @specform[(or expr ...)] -The @scheme[and] form produces @scheme[#f] if any of its -@scheme[_expr]s produces @scheme[#f]. Otherwise, it produces the first +The @scheme[or] form produces @scheme[#f] if all of its +@scheme[_expr]s produce @scheme[#f]. Otherwise, it produces the first non-@scheme[#f] value from its @scheme[expr]s. As a special case, @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 @scheme[or] form, then the @scheme[_expr]'s value directly determines 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. @guideother{@secref["tail-recursion"] introduces tail calls and tail positions.} diff --git a/collects/scribblings/guide/lists.scrbl b/collects/scribblings/guide/lists.scrbl index a908eb746b..7ab1ec6181 100644 --- a/collects/scribblings/guide/lists.scrbl +++ b/collects/scribblings/guide/lists.scrbl @@ -99,7 +99,7 @@ extra first argument. Also, a starting ``current'' value must be provided before the lists: @interaction[ -(foldl (lambda (v elem) +(foldl (lambda (elem v) (+ v (* elem elem))) 0 '(1 2 3))