r7rs-small-texinfo

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 34483e94917ebb265e8e6b975e5e7f380dae1538
parent 44f21bb69fe3e7d8d4d68a61550576fa24a3ea8e
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date:   Mon, 29 Jan 2024 14:05:14 -0500

Replace arrow with @result{} throughout.

Diffstat:
Mdoc/r7rs-small/r7rs-small.texinfo | 832++++++++++++++++++++++++++++++++++++++++----------------------------------------
1 file changed, 416 insertions(+), 416 deletions(-)

diff --git a/doc/r7rs-small/r7rs-small.texinfo b/doc/r7rs-small/r7rs-small.texinfo @@ -539,9 +539,9 @@ string, then the entire string is referred to. @node Evaluation examples @subsection Evaluation examples -The symbol ``⟹'' used in program examples is read ``evaluates to.'' For example, +The symbol ``@result{}'' used in program examples is read ``evaluates to.'' For example, -@code{(* 5 8) ⟹ 40} means that the expression @code{(* 5 8)} evaluates to the object @code{40}. Or, more +@code{(* 5 8) @result{} 40} means that the expression @code{(* 5 8)} evaluates to the object @code{40}. Or, more precisely: the expression given by the sequence of characters ``@code{(* 5 8)}'' evaluates, in an environment containing the base library, to an object that can be represented externally by the sequence of characters `` 40.'' See section 3.3 for a discussion of external @@ -777,7 +777,7 @@ the notation of structures with shared or circular substructure. (let ((x (list 'a 'b 'c))) (set-cdr! (cddr x) x) - x) ⟹ #0=(a b c . #0#) + x) @result{} #0=(a b c . #0#) @end example @@ -793,7 +793,7 @@ In particular, it is an error for quasiquote (section 4.2.8) to contain them. @example #1=(begin (display #\x) #1#) - ⟹ error + @result{} error @end example @@ -1107,7 +1107,7 @@ error to reference an unboundvariable. @example (define x 28) -x ⟹ 28 +x @result{} 28 @end example @@ -1124,9 +1124,9 @@ Scheme code. @example -(quote a) ⟹ a -(quote #(a b c)) ⟹ #(a b c) -(quote (+ 1 2)) ⟹ (+ 1 2) +(quote a) @result{} a +(quote #(a b c)) @result{} #(a b c) +(quote (+ 1 2)) @result{} (+ 1 2) @end example @@ -1135,12 +1135,12 @@ notations are equivalent in all respects. @example -'a ⟹ a -'#(a b c) ⟹ #(a b c) -'() ⟹ () -'(+ 1 2) ⟹ (+ 1 2) -'(quote a) ⟹ (quote a) -''a ⟹ (quote a) +'a @result{} a +'#(a b c) @result{} #(a b c) +'() @result{} () +'(+ 1 2) @result{} (+ 1 2) +'(quote a) @result{} (quote a) +''a @result{} (quote a) @end example @@ -1150,18 +1150,18 @@ they need not be quoted. @example -'145932 ⟹ 145932 -145932 ⟹ 145932 -'"abc" ⟹ "abc" -"abc" ⟹ "abc" -'#\a ⟹ #\a -#\a ⟹ #\a -'#(a 10) ⟹ #(a 10) -#(a 10) ⟹ #(a 10) -'#u8(64 65) ⟹ #u8(64 65) -#u8(64 65) ⟹ #u8(64 65) -'#t ⟹ #t -#t ⟹ #t +'145932 @result{} 145932 +145932 @result{} 145932 +'"abc" @result{} "abc" +"abc" @result{} "abc" +'#\a @result{} #\a +#\a @result{} #\a +'#(a 10) @result{} #(a 10) +#(a 10) @result{} #(a 10) +'#u8(64 65) @result{} #u8(64 65) +#u8(64 65) @result{} #u8(64 65) +'#t @result{} #t +#t @result{} #t @end example @@ -1180,8 +1180,8 @@ is passed the resulting arguments. @example -(+ 3 4) ⟹ 7 -((if #f + *) 3 4) ⟹ 12 +(+ 3 4) @result{} 7 +((if #f + *) 3 4) @result{} 12 @end example @@ -1228,17 +1228,17 @@ will be returned as the results of the procedure call. @example -(lambda (x) (+ x x)) ⟹ a procedure -((lambda (x) (+ x x)) 4) ⟹ 8 +(lambda (x) (+ x x)) @result{} a procedure +((lambda (x) (+ x x)) 4) @result{} 8 (define reverse-subtract (lambda (x y) (- y x))) -(reverse-subtract 7 10) ⟹ 3 +(reverse-subtract 7 10) @result{} 3 (define add4 (let ((x 4)) (lambda (y) (+ x y)))) -(add4 6) ⟹ 10 +(add4 6) @result{} 10 @end example @@ -1269,9 +1269,9 @@ It is an error for a <variable> to appear more than once in <formals>. @example -((lambda x x) 3 4 5 6) ⟹ (3 4 5 6) +((lambda x x) 3 4 5 6) @result{} (3 4 5 6) ((lambda (x y . z) z) - 3 4 5 6) ⟹ (5 6) + 3 4 5 6) @result{} (5 6) @end example @@ -1294,11 +1294,11 @@ value and no <alternate> is specified, then the result of the expression is unsp @example -(if (> 3 2) 'yes 'no) ⟹ yes -(if (> 2 3) 'yes 'no) ⟹ no +(if (> 3 2) 'yes 'no) @result{} yes +(if (> 2 3) 'yes 'no) @result{} no (if (> 3 2) (- 3 2) - (+ 3 2)) ⟹ 1 + (+ 3 2)) @result{} 1 @end example @@ -1315,9 +1315,9 @@ unspecified. @example (define x 2) -(+ x 1) ⟹ 3 -(set! x 4) ⟹ unspecified -(+ x 1) ⟹ 5 +(+ x 1) @result{} 3 +(set! x 4) @result{} unspecified +(+ x 1) @result{} 5 @end example @@ -1389,14 +1389,14 @@ order, and the values of the last one are returned. @example (cond ((> 3 2) 'greater) - ((< 3 2) 'less)) ⟹ greater + ((< 3 2) 'less)) @result{} greater (cond ((> 3 3) 'greater) ((< 3 3) 'less) - (else 'equal)) ⟹ equal + (else 'equal)) @result{} equal (cond ((assv 'b '((a 1) (b 2))) => cadr) - (else #f)) ⟹ 2 + (else #f)) @result{} 2 @end example @@ -1430,14 +1430,14 @@ procedure are returned by the case expression. (case (* 2 3) ((2 3 5 7) 'prime) - ((1 4 6 8 9) 'composite)) ⟹ composite + ((1 4 6 8 9) 'composite)) @result{} composite (case (car '(c d)) ((a) 'a) - ((b) 'b)) ⟹ unspecified + ((b) 'b)) @result{} unspecified (case (car '(c d)) ((a e i o u) 'vowel) ((w y) 'semivowel) - (else => (lambda (x) x))) ⟹ c + (else => (lambda (x) x))) @result{} c @end example @@ -1450,10 +1450,10 @@ are returned. If there are no expressions, then #t is returned. @example -(and (= 2 2) (> 2 1)) ⟹ #t -(and (= 2 2) (< 2 1)) ⟹ #f -(and 1 2 'c '(f g)) ⟹ (f g) -(and) ⟹ #t +(and (= 2 2) (> 2 1)) @result{} #t +(and (= 2 2) (< 2 1)) @result{} #f +(and 1 2 'c '(f g)) @result{} (f g) +(and) @result{} #t @end example @@ -1466,11 +1466,11 @@ expressions, then #f is returned. @example -(or (= 2 2) (> 2 1)) ⟹ #t -(or (= 2 2) (< 2 1)) ⟹ #t -(or #f #f #f) ⟹ #f +(or (= 2 2) (> 2 1)) @result{} #t +(or (= 2 2) (< 2 1)) @result{} #t +(or #f #f #f) @result{} #f (or (memq 'b '(a b c)) - (/ 3 0)) ⟹ (b c) + (/ 3 0)) @result{} (b c) @end example @@ -1485,7 +1485,7 @@ evaluated in order. The result of the when expression is unspecified. (when (= 1 1.0) (display "1") - (display "2")) ⟹ unspecified + (display "2")) @result{} unspecified and prints 12 @end example @@ -1501,7 +1501,7 @@ order. The result of the unless expression is unspecified. (unless (= 1 1.0) (display "1") - (display "2")) ⟹ unspecified + (display "2")) @result{} unspecified and prints nothing @end example @@ -1584,12 +1584,12 @@ are returned. Each binding of a <variable> has <body> as its region. @example (let ((x 2) (y 3)) - (* x y)) ⟹ 6 + (* x y)) @result{} 6 (let ((x 2) (y 3)) (let ((x 7) (z (+ x y))) - (* z x))) ⟹ 35 See also ``named let,'' section 4.2.4. + (* z x))) @result{} 35 See also ``named let,'' section 4.2.4. @end example @@ -1611,7 +1611,7 @@ need not be distinct. (let ((x 2) (y 3)) (let* ((x 7) (z (+ x y))) - (* z x))) ⟹ 70 + (* z x))) @result{} 70 @end example @@ -1643,7 +1643,7 @@ possible to define mutually recursive procedures. #f (even? (- n 1)))))) (even? 88)) -⟹ #t +@result{} #t @end example @@ -1722,7 +1722,7 @@ corresponding <init>. @example (let-values (((root rem) (exact-integer-sqrt 32))) - (* root rem)) ⟹ 35 + (* root rem)) @result{} 35 @end example @@ -1745,7 +1745,7 @@ and so on. (let ((a 'a) (b 'b) (x 'x) (y 'y)) (let*-values (((a b) (values x y)) ((x y) (values a b))) - (list a b x y))) ⟹ (x y x y) + (list a b x y))) @result{} (x y x y) @end example @@ -1779,10 +1779,10 @@ input and output. (and (= x 0) (begin (set! x 5) - (+ x 1))) ⟹ 6 + (+ x 1))) @result{} 6 (begin (display "4 plus 1 equals ") - (display (+ 4 1))) ⟹ unspecified and prints 4 plus 1 equals 5 + (display (+ 4 1))) @result{} unspecified and prints 4 plus 1 equals 5 @end example @@ -1830,12 +1830,12 @@ A <step> can be omitted, in which case the effect is the same as if (<variable> (do ((vec (make-vector 5)) (i 0 (+ i 1))) ((= i 5) vec) - (vector-set! vec i i)) ⟹ #(0 1 2 3 4) + (vector-set! vec i i)) @result{} #(0 1 2 3 4) (let ((x '(1 3 5 7 9))) (do ((x x (cdr x)) (sum 0 (+ sum (car x)))) - ((null? x) sum))) ⟹ 25 + ((null? x) sum))) @result{} 25 @end example @@ -1862,7 +1862,7 @@ Thus the execution of <body> can be repeated by invoking the procedure named by (loop (cdr numbers) nonneg (cons (car numbers) neg))))) -⟹ ((6 1 3) (-5 -2)) +@result{} ((6 1 3) (-5 -2)) @end example @@ -1906,10 +1906,10 @@ promise is not a promise, it may be returned unchanged. @example -(force (delay (+ 1 2))) ⟹ 3 +(force (delay (+ 1 2))) @result{} 3 (let ((p (delay (+ 1 2)))) (list (force p) (force p))) - ⟹ (3 3) + @result{} (3 3) (define integers (letrec ((next @@ -1922,7 +1922,7 @@ promise is not a promise, it may be returned unchanged. (lambda (stream) (cdr (force stream)))) (head (tail (tail integers))) - ⟹ 2 + @result{} 2 @end example @@ -1946,7 +1946,7 @@ force will in effect force such sequences iteratively. (stream-filter p? t)))))) (head (tail (tail (stream-filter odd? integers)))) - ⟹ 5 + @result{} 5 @end example @@ -1964,11 +1964,11 @@ is computed for a promise, no matter how many times it is forced. count (force p))))) (define x 5) -p ⟹ a promise -(force p) ⟹ 6 -p ⟹ a promise, still +p @result{} a promise +(force p) @result{} 6 +p @result{} a promise, still (begin (set! x 10) - (force p)) ⟹ 6 + (force p)) @result{} 6 @end example @@ -1981,8 +1981,8 @@ are supported in some implementations: distinguished from its forced value. That is, expressions like the following may evaluate to either #t or to #f, depending on the implementation: - (eqv? (delay 1) 1) ⟹ unspecified - (pair? (delay (cons 1 2))) ⟹ unspecified + (eqv? (delay 1) 1) @result{} unspecified + (pair? (delay (cons 1 2))) @result{} unspecified * Implementations may implement ``implicit forcing,'' where the value of a promise is forced by procedures that operate only on arguments of a certain type, like cdr and *. However, procedures that operate uniformly on their arguments, like list, must not @@ -1990,9 +1990,9 @@ are supported in some implementations: @example -(+ (delay (* 3 7)) 13) ⟹ unspecified +(+ (delay (* 3 7)) 13) @result{} unspecified (car - (list (delay (* 3 7)) 13)) ⟹ a promise + (list (delay (* 3 7)) 13)) @result{} a promise @end example @@ -2083,15 +2083,15 @@ without the need to pass the value to every procedure in the call chain explicit (define (f n) (number->string n (radix))) -(f 12) ⟹ "12" +(f 12) @result{} "12" (parameterize ((radix 2)) - (f 12)) ⟹ "1100" -(f 12) ⟹ "12" + (f 12)) @result{} "1100" +(f 12) @result{} "12" -(radix 16) ⟹ unspecified +(radix 16) @result{} unspecified (parameterize ((radix 0)) - (f 12)) ⟹ error + (f 12)) @result{} error @end example @@ -2121,13 +2121,13 @@ See section 6.11 for a more complete discussion of exceptions. ((assq 'a condition) => cdr) ((assq 'b condition))) (raise (list (cons 'a 42)))) -⟹ 42 +@result{} 42 (guard (condition ((assq 'a condition) => cdr) ((assq 'b condition))) (raise (list (cons 'b 23)))) -⟹ (b . 23) +@result{} (b . 23) @end example @@ -2159,18 +2159,18 @@ or vector <qq template>. @example -`(list ,(+ 1 2) 4) ⟹ (list 3 4) +`(list ,(+ 1 2) 4) @result{} (list 3 4) (let ((name 'a)) `(list ,name ',name)) -⟹ (list a (quote a)) +@result{} (list a (quote a)) `(a ,(+ 1 2) ,@@(map abs '(4 -5 6)) b) -⟹ (a 3 4 5 6 b) +@result{} (a 3 4 5 6 b) `(( foo ,(- 10 3)) ,@@(cdr '(c)) . ,(car '(cons))) -⟹ ((foo 7) . cons) +@result{} ((foo 7) . cons) `#(10 5 ,(sqrt 4) ,@@(map sqrt '(16 9)) 8) -⟹ #(10 5 2 4 3 8) +@result{} #(10 5 2 4 3 8) (let ((foo '(foo bar)) (@@baz 'baz)) `(list ,@@foo , @@baz)) -⟹ (list foo bar baz) +@result{} (list foo bar baz) @end example @@ -2182,11 +2182,11 @@ decreases by one inside each unquotation. @example `(a `(b ,(+ 1 2) ,(foo ,(+ 1 3) d) e) f) -⟹ (a `(b ,(+ 1 2) ,(foo 4 d) e) f) +@result{} (a `(b ,(+ 1 2) ,(foo 4 d) e) f) (let ((name1 'x) (name2 'y)) `(a `(b ,,name1 ,',name2 d) e)) -⟹ (a `(b ,x ,'y d) e) +@result{} (a `(b ,x ,'y d) e) @end example @@ -2222,9 +2222,9 @@ write procedure may output either format. @example (quasiquote (list (unquote (+ 1 2)) 4)) -⟹ (list 3 4) +@result{} (list 3 4) '(quasiquote (list (unquote (+ 1 2)) 4)) -⟹ `(list ,(+ 1 2) 4) +@result{} `(list ,(+ 1 2) 4) i.e., (quasiquote (list (unquote (+ 1 2)) 4)) @end example @@ -2260,8 +2260,8 @@ It is an error for the arguments not to agree with the <formals> of any <clause> (e (- e 1) (- e 1))) ((< e b) r))))) -(range 3) ⟹ (0 1 2) -(range 3 5) ⟹ (3 4) +(range 3) @result{} (0 1 2) +(range 3 5) @result{} (3 4) @end example @@ -2342,12 +2342,12 @@ the <keyword>s, bound to the specified transformers. Each binding of a <keyword> stmt2 ...)))))) (let ((if #t)) (given-that if (set! if 'now)) - if)) ⟹ now + if)) @result{} now (let ((x 'outer)) (let-syntax ((m (syntax-rules () ((m) x)))) (let ((x 'inner)) - (m)))) ⟹ outer + (m)))) @result{} outer @end example @@ -2381,7 +2381,7 @@ expression. (my-or x (let temp) (if y) - y))) ⟹ 7 + y))) @result{} 7 @end example @@ -2516,7 +2516,7 @@ expand into code containing ellipses. (begin expr (... ...)))))))) (be-like-begin sequence) -(sequence 1 2 3 4) ⟹ 4 +(sequence 1 2 3 4) @result{} 4 @end example @@ -2526,7 +2526,7 @@ they are hygienic (as required) and the following is not an error. @example (let ((=> #f)) - (cond (#t => 'ok))) ⟹ ok + (cond (#t => 'ok))) @result{} ok @end example @@ -2725,9 +2725,9 @@ error to perform a set! on an unboundvariable. (define add3 (lambda (x) (+ x 3))) -(add3 3) ⟹ 6 +(add3 3) @result{} 6 (define first car) -(first '(1 2)) ⟹ 1 +(first '(1 2)) @result{} 1 @end example @@ -2747,7 +2747,7 @@ the entire <body>. For example, (let ((x 5)) (define foo (lambda (y) (bar x y))) (define bar (lambda (a b) (+ (* a b) a))) - (foo (+ x 3))) ⟹ 45 + (foo (+ x 3))) @result{} 45 @end example @@ -2792,11 +2792,11 @@ a procedure call. @example (define-values (x y) (exact-integer-sqrt 17)) -(list x y) ⟹ (4 1) +(list x y) @result{} (4 1) (let () (define-values (x y) (values 1 2)) - (+ x y)) ⟹ 3 + (+ x y)) @result{} 3 @end example @@ -2828,7 +2828,7 @@ precedes an inner definition will not apply an outer definition. (set! a b) (set! b tmp))))) (swap! x y) - (list x y)) ⟹ (2 1) + (list x y)) @result{} (2 1) @end example @@ -2925,13 +2925,13 @@ and pare? to be a predicate for instances of <pare>. @example -(pare? (kons 1 2)) ⟹ #t - (pare? (cons 1 2)) ⟹ #f - (kar (kons 1 2)) ⟹ 1 - (kdr (kons 1 2)) ⟹ 2 +(pare? (kons 1 2)) @result{} #t + (pare? (cons 1 2)) @result{} #f + (kar (kons 1 2)) @result{} 1 + (kdr (kons 1 2)) @result{} 2 (let ((k (kons 1 2))) (set-kar! k 3) - (kar k)) ⟹ 3 + (kar k)) @result{} 3 @end example @@ -3306,19 +3306,19 @@ The eqv? procedure returns #f if: @example -(eqv? 'a 'a) ⟹ #t -(eqv? 'a 'b) ⟹ #f -(eqv? 2 2) ⟹ #t -(eqv? 2 2.0) ⟹ #f -(eqv? '() '()) ⟹ #t -(eqv? 100000000 100000000) ⟹ #t -(eqv? 0.0 +nan.0) ⟹ #f -(eqv? (cons 1 2) (cons 1 2)) ⟹ #f +(eqv? 'a 'a) @result{} #t +(eqv? 'a 'b) @result{} #f +(eqv? 2 2) @result{} #t +(eqv? 2 2.0) @result{} #f +(eqv? '() '()) @result{} #t +(eqv? 100000000 100000000) @result{} #t +(eqv? 0.0 +nan.0) @result{} #f +(eqv? (cons 1 2) (cons 1 2)) @result{} #f (eqv? (lambda () 1) - (lambda () 2)) ⟹ #f + (lambda () 2)) @result{} #f (let ((p (lambda (x) x))) - (eqv? p p)) ⟹ #t -(eqv? #f 'nil) ⟹ #f + (eqv? p p)) @result{} #t +(eqv? #f 'nil) @result{} #f @end example @@ -3328,14 +3328,14 @@ value returned by eqv? must be a boolean. @example -(eqv? "" "") ⟹ unspecified -(eqv? '#() '#()) ⟹ unspecified +(eqv? "" "") @result{} unspecified +(eqv? '#() '#()) @result{} unspecified (eqv? (lambda (x) x) - (lambda (x) x)) ⟹ unspecified + (lambda (x) x)) @result{} unspecified (eqv? (lambda (x) x) - (lambda (y) y)) ⟹ unspecified -(eqv? 1.0e0 1.0f0) ⟹ unspecified -(eqv? +nan.0 +nan.0) ⟹ unspecified + (lambda (y) y)) @result{} unspecified +(eqv? 1.0e0 1.0f0) @result{} unspecified +(eqv? +nan.0 +nan.0) @result{} unspecified @end example @@ -3356,27 +3356,27 @@ equivalence. (let ((n 0)) (lambda () (set! n (+ n 1)) n)))) (let ((g (gen-counter))) - (eqv? g g)) ⟹ #t + (eqv? g g)) @result{} #t (eqv? (gen-counter) (gen-counter)) - ⟹ #f + @result{} #f (define gen-loser (lambda () (let ((n 0)) (lambda () (set! n (+ n 1)) 27)))) (let ((g (gen-loser))) - (eqv? g g)) ⟹ #t + (eqv? g g)) @result{} #t (eqv? (gen-loser) (gen-loser)) - ⟹ unspecified + @result{} unspecified (letrec ((f (lambda () (if (eqv? f g) 'both 'f))) (g (lambda () (if (eqv? f g) 'both 'g)))) (eqv? f g)) - ⟹ unspecified + @result{} unspecified (letrec ((f (lambda () (if (eqv? f g) 'f 'both))) (g (lambda () (if (eqv? f g) 'g 'both)))) (eqv? f g)) - ⟹ #f + @result{} #f @end example @@ -3387,11 +3387,11 @@ implementation-dependent. @example -(eqv? '(a) '(a)) ⟹ unspecified -(eqv? "a" "a") ⟹ unspecified -(eqv? '(b) (cdr '(a b))) ⟹ unspecified +(eqv? '(a) '(a)) @result{} unspecified +(eqv? "a" "a") @result{} unspecified +(eqv? '(b) (cdr '(a b))) @result{} unspecified (let ((x '(a))) - (eqv? x x)) ⟹ #t + (eqv? x x)) @result{} #t @end example @@ -3421,23 +3421,23 @@ behave differently from eqv?. @example -(eq? 'a 'a) ⟹ #t -(eq? '(a) '(a)) ⟹ unspecified -(eq? (list 'a) (list 'a)) ⟹ #f -(eq? "a" "a") ⟹ unspecified -(eq? "" "") ⟹ unspecified -(eq? '() '()) ⟹ #t -(eq? 2 2) ⟹ unspecified -(eq? #\A #\A) ⟹ unspecified -(eq? car car) ⟹ #t +(eq? 'a 'a) @result{} #t +(eq? '(a) '(a)) @result{} unspecified +(eq? (list 'a) (list 'a)) @result{} #f +(eq? "a" "a") @result{} unspecified +(eq? "" "") @result{} unspecified +(eq? '() '()) @result{} #t +(eq? 2 2) @result{} unspecified +(eq? #\A #\A) @result{} unspecified +(eq? car car) @result{} #t (let ((n (+ 2 3))) - (eq? n n)) ⟹ unspecified + (eq? n n)) @result{} unspecified (let ((x '(a))) - (eq? x x)) ⟹ #t + (eq? x x)) @result{} #t (let ((x '#())) - (eq? x x)) ⟹ #t + (eq? x x)) @result{} #t (let ((p (lambda (x) x))) - (eq? p p)) ⟹ #t + (eq? p p)) @result{} #t @end example @@ -3459,18 +3459,18 @@ structures, equal? must always terminate. @example -(equal? 'a 'a) ⟹ #t -(equal? '(a) '(a)) ⟹ #t +(equal? 'a 'a) @result{} #t +(equal? '(a) '(a)) @result{} #t (equal? '(a (b) c) - '(a (b) c)) ⟹ #t -(equal? "abc" "abc") ⟹ #t -(equal? 2 2) ⟹ #t + '(a (b) c)) @result{} #t +(equal? "abc" "abc") @result{} #t +(equal? 2 2) @result{} #t (equal? (make-vector 5 'a) - (make-vector 5 'a)) ⟹ #t + (make-vector 5 'a)) @result{} #t (equal? '#1=(a b . #1#) - '#2=(a b a b . #2#)) ⟹ #t + '#2=(a b a b . #2#)) @result{} #t (equal? (lambda (x) x) - (lambda (y) y)) ⟹ unspecified + (lambda (y) y)) @result{} unspecified @end example @@ -3794,21 +3794,21 @@ The numbers +inf.0, -inf.0, and +nan.0 are real but not rational. @example -(complex? 3+4i) ⟹ #t -(complex? 3) ⟹ #t -(real? 3) ⟹ #t -(real? -2.5+0i) ⟹ #t -(real? -2.5+0.0i) ⟹ #f -(real? #e1e10) ⟹ #t -(real? +inf.0) ⟹ #t -(real? +nan.0) ⟹ #t -(rational? -inf.0) ⟹ #f -(rational? 3.5) ⟹ #t -(rational? 6/10) ⟹ #t -(rational? 6/3) ⟹ #t -(integer? 3+0i) ⟹ #t -(integer? 3.0) ⟹ #t -(integer? 8/4) ⟹ #t +(complex? 3+4i) @result{} #t +(complex? 3) @result{} #t +(real? 3) @result{} #t +(real? -2.5+0i) @result{} #t +(real? -2.5+0.0i) @result{} #f +(real? #e1e10) @result{} #t +(real? +inf.0) @result{} #t +(real? +nan.0) @result{} #t +(rational? -inf.0) @result{} #f +(rational? 3.5) @result{} #t +(rational? 6/10) @result{} #t +(rational? 6/3) @result{} #t +(integer? 3+0i) @result{} #t +(integer? 3.0) @result{} #t +(integer? 8/4) @result{} #t @end example @@ -3831,9 +3831,9 @@ number, precisely one of these predicates is true. @example -(exact? 3.0) ⟹ #f -(exact? #e3.0) ⟹ #t -(inexact? 3.) ⟹ #t +(exact? 3.0) @result{} #f +(exact? #e3.0) @result{} #t +(inexact? 3.) @result{} #t @end example @@ -3846,9 +3846,9 @@ z is both exact and an integer; otherwise returns #f. @example -(exact-integer? 32) ⟹ #t -(exact-integer? 32.0) ⟹ #f -(exact-integer? 32/5) ⟹ #f +(exact-integer? 32) @result{} #t +(exact-integer? 32.0) @result{} #f +(exact-integer? 32/5) @result{} #f @end example @@ -3861,9 +3861,9 @@ on complex numbers if their real and imaginary parts are both finite. Otherwise @example -(finite? 3) ⟹ #t -(finite? +inf.0) ⟹ #f -(finite? 3.0+inf.0i) ⟹ #f +(finite? 3) @result{} #t +(finite? +inf.0) @result{} #f +(finite? 3.0+inf.0i) @result{} #f @end example @@ -3875,10 +3875,10 @@ numbers if their real or imaginary parts or both are infinite. Otherwise it retu @example -(infinite? 3) ⟹ #f -(infinite? +inf.0) ⟹ #t -(infinite? +nan.0) ⟹ #f -(infinite? 3.0+inf.0i) ⟹ #t +(infinite? 3) @result{} #f +(infinite? +inf.0) @result{} #t +(infinite? +nan.0) @result{} #f +(infinite? 3.0+inf.0i) @result{} #t @end example @@ -3890,10 +3890,10 @@ imaginary parts or both are +nan.0. Otherwise it returns #f. @example -(nan? +nan.0) ⟹ #t -(nan? 32) ⟹ #f -(nan? +nan.0+5.0i) ⟹ #t -(nan? 1+2i) ⟹ #f +(nan? +nan.0) @result{} #t +(nan? 32) @result{} #f +(nan? +nan.0+5.0i) @result{} #t +(nan? 1+2i) @result{} #f @end example @@ -3960,8 +3960,8 @@ These procedures return the maximum or minimum of their arguments. @example -(max 3 4) ⟹ 4 ; exact -(max 3.9 4) ⟹ 4.0 ; inexact +(max 3 4) @result{} 4 ; exact +(max 3.9 4) @result{} 4.0 ; inexact @end example @@ -3982,11 +3982,11 @@ These procedures return the sum or product of their arguments. @example -(+ 3 4) ⟹ 7 -(+ 3) ⟹ 3 -(+) ⟹ 0 -(* 4) ⟹ 4 -(*) ⟹ 1 +(+ 3 4) @result{} 7 +(+ 3) @result{} 3 +(+) @result{} 0 +(* 4) @result{} 4 +(*) @result{} 1 @end example @@ -4012,11 +4012,11 @@ other arguments is a NaN. @example -(- 3 4) ⟹ -1 -(- 3 4 5) ⟹ -6 -(- 3) ⟹ -3 -(/ 3 4 5) ⟹ 3/20 -(/ 3) ⟹ 1/3 +(- 3 4) @result{} -1 +(- 3 4 5) @result{} -6 +(- 3) @result{} -3 +(/ 3 4 5) @result{} 3/20 +(/ 3) @result{} 1/3 @end example @@ -4026,7 +4026,7 @@ The abs procedure returns the absolute value of its argument. @example -(abs -7) ⟹ 7 +(abs -7) @result{} 7 @end example @@ -4069,7 +4069,7 @@ nr. For each of the division operators, there are three procedures defined as fo n1 -n2) ⟹ +n2) @result{} nq @@ -4078,14 +4078,14 @@ nr n1 -n2) ⟹ +n2) @result{} nq (<operator>-remainder n1 -n2) ⟹ +n2) @result{} nr @@ -4138,7 +4138,7 @@ n2)) n1 n2))) - ⟹ #t + @result{} #t provided all numbers involved in that computation are exact. @@ -4146,15 +4146,15 @@ Examples: @example -(floor/ 5 2) ⟹ 2 1 -(floor/ -5 2) ⟹ -3 1 -(floor/ 5 -2) ⟹ -3 -1 -(floor/ -5 -2) ⟹ 2 -1 -(truncate/ 5 2) ⟹ 2 1 -(truncate/ -5 2) ⟹ -2 -1 -(truncate/ 5 -2) ⟹ -2 1 -(truncate/ -5 -2) ⟹ 2 -1 -(truncate/ -5.0 -2) ⟹ 2.0 -1.0 +(floor/ 5 2) @result{} 2 1 +(floor/ -5 2) @result{} -3 1 +(floor/ 5 -2) @result{} -3 -1 +(floor/ -5 -2) @result{} 2 -1 +(truncate/ 5 2) @result{} 2 1 +(truncate/ -5 2) @result{} -2 -1 +(truncate/ 5 -2) @result{} -2 1 +(truncate/ -5 -2) @result{} 2 -1 +(truncate/ -5.0 -2) @result{} 2.0 -1.0 @end example @@ -4184,11 +4184,11 @@ arguments. The result is always non-negative. @example -(gcd 32 -36) ⟹ 4 -(gcd) ⟹ 0 -(lcm 32 -36) ⟹ 288 -(lcm 32.0 -36) ⟹ 288.0 ; inexact -(lcm) ⟹ 1 +(gcd 32 -36) @result{} 4 +(gcd) @result{} 0 +(lcm 32 -36) @result{} 288 +(lcm 32.0 -36) @result{} 288.0 ; inexact +(lcm) @result{} 1 @end example @@ -4204,10 +4204,10 @@ denominator is always positive. The denominator of 0 is defined to be 1. @example -(numerator (/ 6 4)) ⟹ 3 -(denominator (/ 6 4)) ⟹ 2 +(numerator (/ 6 4)) @result{} 3 +(denominator (/ 6 4)) @result{} 2 (denominator - (inexact (/ 6 4))) ⟹ 2.0 + (inexact (/ 6 4))) @result{} 2.0 @end example @@ -4240,18 +4240,18 @@ x is halfway between two integers. @example -(floor -4.3) ⟹ -5.0 -(ceiling -4.3) ⟹ -4.0 -(truncate -4.3) ⟹ -4.0 -(round -4.3) ⟹ -4.0 +(floor -4.3) @result{} -5.0 +(ceiling -4.3) @result{} -4.0 +(truncate -4.3) @result{} -4.0 +(round -4.3) @result{} -4.0 -(floor 3.5) ⟹ 3.0 -(ceiling 3.5) ⟹ 4.0 -(truncate 3.5) ⟹ 3.0 -(round 3.5) ⟹ 4.0 ; inexact +(floor 3.5) @result{} 3.0 +(ceiling 3.5) @result{} 4.0 +(truncate 3.5) @result{} 3.0 +(round 3.5) @result{} 4.0 ; inexact -(round 7/2) ⟹ 4 ; exact -(round 7) ⟹ 7 +(round 7/2) @result{} 4 ; exact +(round 7) @result{} 7 @end example @@ -4271,8 +4271,8 @@ rational of all. @example (rationalize - (exact .3) 1/10) ⟹ 1/3 ; exact -(rationalize .3 1/10) ⟹ #i1/3 ; inexact + (exact .3) 1/10) @result{} 1/3 ; exact +(rationalize .3 1/10) @result{} #i1/3 ; inexact @end example @@ -4377,8 +4377,8 @@ Returns the square of z. This is equivalent to @code{(* z z)}. @example -(square 42) ⟹ 1764 -(square 2.0) ⟹ 4.0 +(square 42) @result{} 1764 +(square 2.0) @result{} 4.0 @end example @@ -4392,8 +4392,8 @@ imaginary part. @example -(sqrt 9) ⟹ 3 -(sqrt -1) ⟹ +i +(sqrt 9) @result{} 3 +(sqrt -1) @result{} +i @end example @@ -4407,8 +4407,8 @@ k < (s + 1)2. @example -(exact-integer-sqrt 4) ⟹ 2 0 -(exact-integer-sqrt 5) ⟹ 2 1 +(exact-integer-sqrt 4) @result{} 2 0 +(exact-integer-sqrt 5) @result{} 2 1 @end example @@ -4466,12 +4466,12 @@ Then all of @example -(make-rectangular x1 x2) ⟹ z -(make-polar x3 x4) ⟹ z -(real-part z) ⟹ x1 -(imag-part z) ⟹ x2 -(magnitude z) ⟹ |x3| -(angle z) ⟹ xangle +(make-rectangular x1 x2) @result{} z +(make-polar x3 x4) @result{} z +(real-part z) @result{} x1 +(imag-part z) @result{} x2 +(magnitude z) @result{} |x3| +(angle z) @result{} xangle @end example @@ -4595,9 +4595,9 @@ string. @example -(string->number "100") ⟹ 100 -(string->number "100" 16) ⟹ 256 -(string->number "1e2") ⟹ 100.0 +(string->number "100") @result{} 100 +(string->number "100" 16) @result{} 256 +(string->number "1e2") @result{} 100.0 @end example @@ -4639,9 +4639,9 @@ programs. @example -#t ⟹ #t -#f ⟹ #f -'#f ⟹ #f +#t @result{} #t +#f @result{} #f +'#f @result{} #f @end example @@ -4653,13 +4653,13 @@ obj is false, and returns #f otherwise. @example -(not #t) ⟹ #f -(not 3) ⟹ #f -(not (list 3)) ⟹ #f -(not #f) ⟹ #t -(not '()) ⟹ #f -(not (list)) ⟹ #f -(not 'nil) ⟹ #f +(not #t) @result{} #f +(not 3) @result{} #f +(not (list 3)) @result{} #f +(not #f) @result{} #t +(not '()) @result{} #f +(not (list)) @result{} #f +(not 'nil) @result{} #f @end example @@ -4671,9 +4671,9 @@ obj is either #t or #f and returns #f otherwise. @example -(boolean? #f) ⟹ #t -(boolean? 0) ⟹ #f -(boolean? '()) ⟹ #f +(boolean? #f) @result{} #t +(boolean? 0) @result{} #f +(boolean? '()) @result{} #f @end example @@ -4756,15 +4756,15 @@ next: (define x (list 'a 'b 'c)) (define y x) -y ⟹ (a b c) -(list? y) ⟹ #t -(set-cdr! x 4) ⟹ unspecified -x ⟹ (a . 4) -(eqv? x y) ⟹ #t -y ⟹ (a . 4) -(list? y) ⟹ #f -(set-cdr! x x) ⟹ unspecified -(list? x) ⟹ #f Within literal expressions and representations of objects read by the +y @result{} (a b c) +(list? y) @result{} #t +(set-cdr! x 4) @result{} unspecified +x @result{} (a . 4) +(eqv? x y) @result{} #t +y @result{} (a . 4) +(list? y) @result{} #f +(set-cdr! x x) @result{} unspecified +(list? x) @result{} #f Within literal expressions and representations of objects read by the read procedure, the forms '<datum>, `<datum>, ,<datum>, and ,@@<datum> denote two-element lists whose first elements are the symbols quote, quasiquote, unquote, and unquote-splicing, respectively. The second element in each case is <datum>. This @@ -4779,10 +4779,10 @@ The pair? predicate returns #t if obj is a pair, and otherwise returns #f. -(pair? '(a . b)) ⟹ #t -(pair? '(a b c)) ⟹ #t -(pair? '()) ⟹ #f -(pair? '#(a b)) ⟹ #f +(pair? '(a . b)) @result{} #t +(pair? '(a b c)) @result{} #t +(pair? '()) @result{} #f +(pair? '#(a b)) @result{} #f procedure: (cons obj1 obj2) @@ -4794,11 +4794,11 @@ obj1 and whose cdr is obj2. The pair is guaranteed to be different (in the sense of eqv?) from every existing object. -(cons 'a '()) ⟹ (a) -(cons '(a) '(b c d)) ⟹ ((a) b c d) -(cons "a" '(b c)) ⟹ ("a" b c) -(cons 'a 3) ⟹ (a . 3) -(cons '(a b) 'c) ⟹ ((a b) . c) +(cons 'a '()) @result{} (a) +(cons '(a) '(b c d)) @result{} ((a) b c d) +(cons "a" '(b c)) @result{} ("a" b c) +(cons 'a 3) @result{} (a . 3) +(cons '(a b) 'c) @result{} ((a b) . c) procedure: (car pair) @@ -4806,10 +4806,10 @@ Returns the contents of the car field of pair. Note that it is an error to take the car of the empty list. -(car '(a b c)) ⟹ a -(car '((a) b c d)) ⟹ (a) -(car '(1 . 2)) ⟹ 1 -(car '()) ⟹ error +(car '(a b c)) @result{} a +(car '((a) b c d)) @result{} (a) +(car '(1 . 2)) @result{} 1 +(car '()) @result{} error procedure: (cdr pair) @@ -4817,9 +4817,9 @@ Returns the contents of the cdr field of pair. Note that it is an error to take the cdr of the empty list. -(cdr '((a) b c d)) ⟹ (b c d) -(cdr '(1 . 2)) ⟹ 2 -(cdr '()) ⟹ error +(cdr '((a) b c d)) @result{} (b c d) +(cdr '(1 . 2)) @result{} 2 +(cdr '()) @result{} error procedure: (set-car! pair obj) @@ -4831,8 +4831,8 @@ pair. (define (f) (list 'not-a-constant-list)) (define (g) '(constant-list)) -(set-car! (f) 3) ⟹ unspecified -(set-car! (g) 3) ⟹ error +(set-car! (f) 3) @result{} unspecified +(set-car! (g) 3) @result{} error procedure: (set-cdr! pair obj) @@ -4891,12 +4891,12 @@ terminated by the empty list. @example -(list? '(a b c)) ⟹ #t - (list? '()) ⟹ #t - (list? '(a . b)) ⟹ #f +(list? '(a b c)) @result{} #t + (list? '()) @result{} #t + (list? '(a . b)) @result{} #f (let ((x (list 'a))) (set-cdr! x x) - (list? x)) ⟹ #f + (list? x)) @result{} #f @end example @@ -4911,7 +4911,7 @@ fill. Otherwise the initial contents of each element is unspecified. @example -(make-list 2 3) ⟹ (3 3) +(make-list 2 3) @result{} (3 3) @end example @@ -4922,8 +4922,8 @@ Returns a newly allocated list of its arguments. @example -(list 'a (+ 3 4) 'c) ⟹ (a 7 c) -(list) ⟹ () +(list 'a (+ 3 4) 'c) @result{} (a 7 c) +(list) @result{} () @end example @@ -4933,9 +4933,9 @@ Returns the length of @var{list}. @example -(length '(a b c)) ⟹ 3 -(length '(a (b) (c d e))) ⟹ 3 -(length '()) ⟹ 0 +(length '(a b c)) @result{} 3 +(length '(a (b) (c d e))) @result{} 3 +(length '()) @result{} 0 @end example @@ -4952,12 +4952,12 @@ improper list results if the last argument is not a proper list. @example -(append '(x) '(y)) ⟹ (x y) -(append '(a) '(b c d)) ⟹ (a b c d) -(append '(a (b)) '((c))) ⟹ (a (b) (c)) +(append '(x) '(y)) @result{} (x y) +(append '(a) '(b c d)) @result{} (a b c d) +(append '(a (b)) '((c))) @result{} (a (b) (c)) -(append '(a b) '(c . d)) ⟹ (a b c . d) -(append '() 'a) ⟹ a +(append '(a b) '(c . d)) @result{} (a b c . d) +(append '() 'a) @result{} a @end example @@ -4968,9 +4968,9 @@ Returns a newly allocated list consisting of the elements of @example -(reverse '(a b c)) ⟹ (c b a) +(reverse '(a b c)) @result{} (c b a) (reverse '(a (b c) d (e (f)))) -⟹ ((e (f)) d (b c) a) +@result{} ((e (f)) d (b c) a) @end example @@ -5022,10 +5022,10 @@ k).) @example -(list-ref '(a b c d) 2) ⟹ c +(list-ref '(a b c d) 2) @result{} c (list-ref '(a b c d) (exact (round 1.8))) -⟹ c +@result{} c @end example @@ -5050,10 +5050,10 @@ list. (let ((ls (list 'one 'two 'five!))) (list-set! ls 2 'three) ls) -⟹ (one two three) +@result{} (one two three) (list-set! '(0 1 2) 1 "oops") -⟹ error ; constant list +@result{} error ; constant list @end example @@ -5090,17 +5090,17 @@ compare, if given, and equal? otherwise. @example -(memq 'a '(a b c)) ⟹ (a b c) -(memq 'b '(a b c)) ⟹ (b c) -(memq 'a '(b c d)) ⟹ #f -(memq (list 'a) '(b (a) c)) ⟹ #f +(memq 'a '(a b c)) @result{} (a b c) +(memq 'b '(a b c)) @result{} (b c) +(memq 'a '(b c d)) @result{} #f +(memq (list 'a) '(b (a) c)) @result{} #f (member (list 'a) - '(b (a) c)) ⟹ ((a) c) + '(b (a) c)) @result{} ((a) c) (member "B" '("a" "b" "c") - string-ci=?) ⟹ ("b" "c") -(memq 101 '(100 101 102)) ⟹ unspecified -(memv 101 '(100 101 102)) ⟹ (101 102) + string-ci=?) @result{} ("b" "c") +(memq 101 '(100 101 102)) @result{} unspecified +(memv 101 '(100 101 102)) @result{} (101 102) @end example @@ -5133,19 +5133,19 @@ compare if given and equal? otherwise. @example (define e '((a 1) (b 2) (c 3))) -(assq 'a e) ⟹ (a 1) -(assq 'b e) ⟹ (b 2) -(assq 'd e) ⟹ #f +(assq 'a e) @result{} (a 1) +(assq 'b e) @result{} (b 2) +(assq 'd e) @result{} #f (assq (list 'a) '(((a)) ((b)) ((c)))) - ⟹ #f + @result{} #f (assoc (list 'a) '(((a)) ((b)) ((c)))) - ⟹ ((a)) + @result{} ((a)) (assoc 2.0 '((1 1) (2 4) (3 9)) =) - ⟹ (2 4) + @result{} (2 4) (assq 5 '((2 3) (5 7) (11 13))) - ⟹ unspecified + @result{} unspecified (assv 5 '((2 3) (5 7) (11 13))) - ⟹ (5 7) + @result{} (5 7) @end example @@ -5174,8 +5174,8 @@ obj is a circular list. (define a '(1 8 2 8)) ; a may be immutable (define b (list-copy a)) (set-car! b 3) ; b is mutable -b ⟹ (3 8 2 8) -a ⟹ (1 8 2 8) +b @result{} (3 8 2 8) +a @result{} (1 8 2 8) @end example @@ -5206,12 +5206,12 @@ obj is a symbol, otherwise returns #f. @example -(symbol? 'foo) ⟹ #t -(symbol? (car '(a b))) ⟹ #t -(symbol? "bar") ⟹ #f -(symbol? 'nil) ⟹ #t -(symbol? '()) ⟹ #f -(symbol? #f) ⟹ #f +(symbol? 'foo) @result{} #t +(symbol? (car '(a b))) @result{} #t +(symbol? "bar") @result{} #f +(symbol? 'nil) @result{} #t +(symbol? '()) @result{} #f +(symbol? #f) @result{} #f @end example @@ -5233,11 +5233,11 @@ procedures like string-set! to strings returned by this procedure. @example (symbol->string 'flying-fish) - ⟹ "flying-fish" -(symbol->string 'Martin) ⟹ "Martin" + @result{} "flying-fish" +(symbol->string 'Martin) @result{} "Martin" (symbol->string (string->symbol "Malvina")) - ⟹ "Malvina" + @result{} "Malvina" @end example @@ -5251,17 +5251,17 @@ would require escaping when written, but does not interpret escapes in its input @example (string->symbol "mISSISSIppi") -⟹mISSISSIppi +@result{}mISSISSIppi (eqv? 'bitBlt (string->symbol "bitBlt")) -⟹ #t +@result{} #t (eqv? 'LollyPop (string->symbol (symbol->string 'LollyPop))) -⟹ #t +@result{} #t (string=? "K. Harper, M.D." (symbol->string (string->symbol "K. Harper, M.D."))) -⟹ #t +@result{} #t @end example @@ -5405,10 +5405,10 @@ This procedure returns the numeric value (0 to 9) of its argument if it is a num @example -(digit-value #\3) ⟹ 3 -(digit-value #\x0664) ⟹ 4 -(digit-value #\x0AE6) ⟹ 0 -(digit-value #\x0EA6) ⟹ #f +(digit-value #\3) @result{} 3 +(digit-value #\x0664) @result{} 4 +(digit-value #\x0AE6) @result{} 0 +(digit-value #\x0EA6) @result{} #f @end example @@ -5578,11 +5578,11 @@ string. There is no requirement for this procedure to execute in constant time. (define (f) (make-string 3 #\*)) (define (g) "***") -(string-set! (f) 0 #\?) ⟹ unspecified -(string-set! (g) 0 #\?) ⟹ error +(string-set! (f) 0 #\?) @result{} unspecified +(string-set! (g) 0 #\?) @result{} error (string-set! (symbol->string 'immutable) 0 - #\?) ⟹ error + #\?) @result{} error @end example @@ -5746,7 +5746,7 @@ making sure to copy in the correct direction in such circumstances. (define a "12345") (define b (string-copy "abcde")) (string-copy! b 1 a 0 2) -b ⟹ "a12de" +b @result{} "a12de" @end example @@ -5811,7 +5811,7 @@ analogous to list. @example -(vector 'a 'b 'c) ⟹ #(a b c) +(vector 'a 'b 'c) @result{} #(a b c) @end example @@ -5839,11 +5839,11 @@ vector. (vector-ref '#(1 1 2 3 5 8 13 21) 5) -⟹ 8 +@result{} 8 (vector-ref '#(1 1 2 3 5 8 13 21) (exact (round (* 2 (acos -1))))) -⟹ 13 +@result{} 13 @end example @@ -5868,10 +5868,10 @@ vector. (let ((vec (vector 0 '(2 2 2 2) "Anna"))) (vector-set! vec 1 '("Sue" "Sue")) vec) -⟹ #(0 ("Sue" "Sue") "Anna") +@result{} #(0 ("Sue" "Sue") "Anna") (vector-set! '#(0 1 2) 1 "doe") -⟹ error ; constant vector +@result{} error ; constant vector @end example @@ -5897,11 +5897,11 @@ In both procedures, order is preserved. @example (vector->list '#(dah dah didah)) -⟹ (dah dah didah) +@result{} (dah dah didah) (vector->list '#(dah dah didah) 1 2) -⟹ (dah) +@result{} (dah) (list->vector '(dididit dah)) -⟹ #(dididit dah) +@result{} #(dididit dah) @end example @@ -5940,9 +5940,9 @@ In both procedures, order is preserved. @example -(string->vector "ABC") ⟹ #(#\A #\B #\C) +(string->vector "ABC") @result{} #(#\A #\B #\C) (vector->string - #(#\1 #\2 #\3) ⟹ "123" + #(#\1 #\2 #\3) @result{} "123" @end example @@ -5964,9 +5964,9 @@ of the old. (define a #(1 8 2 8)) ; a may be immutable (define b (vector-copy a)) (vector-set! b 0 3) ; b is mutable -b ⟹ #(3 8 2 8) +b @result{} #(3 8 2 8) (define c (vector-copy b 1 3)) -c ⟹ #(8 2) +c @result{} #(8 2) @end example @@ -6008,7 +6008,7 @@ making sure to copy in the correct direction in such circumstances. (define a (vector 1 2 3 4 5)) (define b (vector 10 20 30 40 50)) (vector-copy! b 1 a 0 2) -b ⟹ #(10 1 2 40 50) +b @result{} #(10 1 2 40 50) @end example @@ -6021,7 +6021,7 @@ of the given vectors. @example (vector-append #(a b c) #(d e f)) -⟹ #(a b c d e f) +@result{} #(a b c d e f) @end example @@ -6044,7 +6044,7 @@ end. (define a (vector 1 2 3 4 5)) (vector-fill! a 'smash 2 4) a -⟹ #(1 2 smash smash 5) +@result{} #(1 2 smash smash 5) @end example @@ -6087,7 +6087,7 @@ byte, otherwise the contents of each element are unspecified. @example -(make-bytevector 2 12) ⟹ #u8(12 12) +(make-bytevector 2 12) @result{} #u8(12 12) @end example @@ -6098,8 +6098,8 @@ Returns a newly allocated bytevector containing its arguments. @example -(bytevector 1 3 5 1 3 5) ⟹ #u8(1 3 5 1 3 5) -(bytevector) ⟹ #u8() +(bytevector 1 3 5 1 3 5) @result{} #u8(1 3 5 1 3 5) +(bytevector) @result{} #u8() @end example @@ -6127,7 +6127,7 @@ bytevector. (bytevector-u8-ref '#u8(1 1 2 3 5 8 13 21) 5) -⟹ 8 +@result{} 8 @end example @@ -6152,7 +6152,7 @@ bytevector. (let ((bv (bytevector 1 2 3 4))) (bytevector-u8-set! bv 1 3) bv) -⟹ #u8(1 3 3 4) +@result{} #u8(1 3 3 4) @end example @@ -6171,7 +6171,7 @@ end. @example (define a #u8(1 2 3 4 5)) -(bytevector-copy a 2 4)) ⟹ #u8(3 4) +(bytevector-copy a 2 4)) @result{} #u8(3 4) @end example @@ -6213,7 +6213,7 @@ by making sure to copy in the correct direction in such circumstances. (define a (bytevector 1 2 3 4 5)) (define b (bytevector 10 20 30 40 50)) (bytevector-copy! b 1 a 0 2) -b ⟹ #u8(10 1 2 40 50) +b @result{} #u8(10 1 2 40 50) @end example @@ -6229,7 +6229,7 @@ elements in the given bytevectors. @example (bytevector-append #u8(0 1 2) #u8(3 4 5)) -⟹ #u8(0 1 2 3 4 5) +@result{} #u8(0 1 2 3 4 5) @end example @@ -6259,8 +6259,8 @@ end and returns the corresponding bytevector. @example -(utf8->string #u8(#x41)) ⟹ "A" -(string->utf8 "λ") ⟹ #u8(#xCE #xBB) +(utf8->string #u8(#x41)) @result{} "A" +(string->utf8 "λ") @result{} #u8(#xCE #xBB) @end example @@ -6280,14 +6280,14 @@ obj is a procedure, otherwise returns #f. @example -(procedure? car) ⟹ #t -(procedure? 'car) ⟹ #f +(procedure? car) @result{} #t +(procedure? 'car) @result{} #f (procedure? (lambda (x) (* x x))) - ⟹ #t + @result{} #t (procedure? '(lambda (x) (* x x))) - ⟹ #f + @result{} #f (call-with-current-continuation procedure?) - ⟹ #t + @result{} #t @end example @@ -6300,14 +6300,14 @@ proc with the elements of the list @code{(append (list arg1 @dots{}) args)} as t @example -(apply + (list 3 4)) ⟹ 7 +(apply + (list 3 4)) @result{} 7 (define compose (lambda (f g) (lambda args (f (apply g args))))) -((compose sqrt *) 12 75) ⟹ 30 +((compose sqrt *) 12 75) @result{} 30 @end example @@ -6339,19 +6339,19 @@ returns are not mutated. @example (map cadr '((a b) (d e) (g h))) -⟹ (b e h) +@result{} (b e h) (map (lambda (n) (expt n n)) '(1 2 3 4 5)) -⟹ (1 4 27 256 3125) +@result{} (1 4 27 256 3125) -(map + '(1 2 3) '(4 5 6 7)) ⟹ (5 7 9) +(map + '(1 2 3) '(4 5 6 7)) @result{} (5 7 9) (let ((count 0)) (map (lambda (ignored) (set! count (+ count 1)) count) - '(a b))) ⟹ (1 2) + '(a b))) @result{} (1 2) or (2 1) @@ -6382,13 +6382,13 @@ earlier returns are not mutated. @example (string-map char-foldcase "AbdEgH") -⟹ "abdegh" +@result{} "abdegh" (string-map (lambda (c) (integer->char (+ 1 (char->integer c)))) "HAL") -⟹ "IBM" +@result{} "IBM" (string-map (lambda (c k) @@ -6396,7 +6396,7 @@ earlier returns are not mutated. c)) "studlycaps xxx" "ululululul") -⟹ "StUdLyCaPs" +@result{} "StUdLyCaPs" @end example @@ -6424,21 +6424,21 @@ earlier returns are not mutated. @example (vector-map cadr '#((a b) (d e) (g h))) -⟹ #(b e h) +@result{} #(b e h) (vector-map (lambda (n) (expt n n)) '#(1 2 3 4 5)) -⟹ #(1 4 27 256 3125) +@result{} #(1 4 27 256 3125) (vector-map + '#(1 2 3) '#(4 5 6 7)) -⟹ #(5 7 9) +@result{} #(5 7 9) (let ((count 0)) (vector-map (lambda (ignored) (set! count (+ count 1)) count) - '#(a b))) ⟹ #(1 2) + '#(a b))) @result{} #(1 2) or #(2 1) @@ -6476,7 +6476,7 @@ proc to mutate any of the lists. (for-each (lambda (i) (vector-set! v i (* i i))) '(0 1 2 3 4)) - v) ⟹ #(0 1 4 9 16) + v) @result{} #(0 1 4 9 16) @end example @@ -6509,7 +6509,7 @@ proc to mutate any of the strings. (string-for-each (lambda (c) (set! v (cons (char->integer c) v))) "abcde") - v) ⟹ (101 100 99 98 97) + v) @result{} (101 100 99 98 97) @end example @@ -6542,7 +6542,7 @@ proc to mutate any of the vectors. (vector-for-each (lambda (i) (list-set! v i (* i i))) '#(0 1 2 3 4)) - v) ⟹ (0 1 4 9 16) + v) @result{} (0 1 4 9 16) @end example @@ -6596,7 +6596,7 @@ call-with-current-continuation. (if (negative? x) (exit x))) '(54 0 37 -3 245 19)) - #t)) ⟹ -3 + #t)) @result{} -3 (define list-length (lambda (obj) @@ -6610,9 +6610,9 @@ call-with-current-continuation. (else (return #f)))))) (r obj)))))) -(list-length '(1 2 3 4)) ⟹ 4 +(list-length '(1 2 3 4)) @result{} 4 -(list-length '(a b . c)) ⟹ #f +(list-length '(a b . c)) @result{} #f @end example @@ -6663,9 +6663,9 @@ consumer is the continuation of the call to call-with-values. (call-with-values (lambda () (values 4 5)) (lambda (a b) b)) - ⟹ 5 + @result{} 5 -(call-with-values * -) ⟹ -1 +(call-with-values * -) @result{} -1 @end example @@ -6755,7 +6755,7 @@ after is unspecified. (c 'talk2) (reverse path)))) -⟹ (connect talk1 disconnect +@result{} (connect talk1 disconnect connect talk2 disconnect) @end example @@ -6806,7 +6806,7 @@ thunk. (k 'exception)) (lambda () (+ 1 (raise 'an-error)))))) - ⟹ exception + @result{} exception and prints condition: an-error (with-exception-handler @@ -6856,7 +6856,7 @@ the values it returns become the values returned by the call to raise-continuabl (+ (raise-continuable "should be a number") 23))) prints: should be a number - ⟹ 65 + @result{} 65 @end example @@ -6988,15 +6988,15 @@ eval to allow other objects. @example (eval '(* 7 3) (environment '(scheme base))) - ⟹ 21 + @result{} 21 (let ((f (eval '(lambda (f x) (f x x)) (null-environment 5)))) (f + 10)) - ⟹ 20 + @result{} 20 (eval '(define foo 32) (environment '(scheme base))) - ⟹ error is signaled + @result{} error is signaled @end example @@ -7181,7 +7181,7 @@ the order they were output. If the result string is modified, the effect is unsp (newline) (get-output-string (current-output-port))) -⟹ "piece by piece by piece.\n" +@result{} "piece by piece by piece.\n" @end example @@ -7619,7 +7619,7 @@ resulting string. @example (get-environment-variable "PATH") -⟹ "/usr/local/bin:/usr/bin:/bin" +@result{} "/usr/local/bin:/usr/bin:/bin" @end example @@ -7633,7 +7633,7 @@ or the alist itself. @example (get-environment-variables) -⟹ (("USER" . "root") ("HOME" . "/")) +@result{} (("USER" . "root") ("HOME" . "/")) @end example @@ -7687,7 +7687,7 @@ modify this list. Here is an example of what features might return: @example -(features) ⟹ +(features) @result{} (r7rs ratios exact-complex full-unicode gnu-linux little-endian fantastic-scheme