r5rs and srfi docs and bindings

svn: r9336
This commit is contained in:
Matthew Flatt 2008-04-16 20:52:39 +00:00
parent f1fcb1cd61
commit 28a3f3f0e7
157 changed files with 46049 additions and 47 deletions

View File

@ -20,9 +20,9 @@
@title{@bold{R5RS}: Legacy Standard Language}
The ``The Revised@superscript{5} Report on the Algorithmic Language
Scheme'' @cite["Kelsey98"] defines a dialect of Scheme. We use
@defterm{@|r5rs|} to refer to both the standard and the language
The @link["../r5rs-std/index.html"]{The Revised@superscript{5} Report
on the Algorithmic Language Scheme} defines a dialect of Scheme. We
use @defterm{@|r5rs|} to refer to both the standard and the language
defined by the standard.
The default dialect of Scheme provided by @exec{mzscheme} and other
@ -31,6 +31,8 @@ includes tools and libraries for running @|r5rs| programs.
@table-of-contents[]
@redirects[]
@; ----------------------------------------
@section[#:tag "running"]{Running @|r5rs| Programs}
@ -150,24 +152,19 @@ The @scheme[cons] of @schememodname[r5rs] corresponds to
is @scheme[mcdr], and @scheme[map] is @schememodname[scheme/mpair]'s
@scheme[mmap], and so on.
@defproc[(eval [expr any/c] [environment namespace?]) any]{
An @|r5rs| @defterm{environment} is implemented as a
@scheme[scheme/base] @defterm{namespace}. Also, relative to
@scheme[scheme/base], the @scheme[expr] passed to @scheme[eval] is
constructed using mutable pairs.}
constructed using mutable pairs.
@defproc[(scheme-report-environment [n (one-of/c 5)]) namespace?]{
The @scheme[scheme-report-environment] function returns a namespace
containing the bindings of @schememodname[r5rs]. Procedure values are
installed into the namespace using @scheme[namespace-require/copy], so
that they can be redefined.
Returns a namespace containing the bindings of @schememodname[r5rs].
Procedure values are installed into the namespace using
@scheme[namespace-require/copy], so that they can be redefined.}
@defproc[(scheme-null-environment [n (one-of/c 5)]) namespace?]{
Returns a namespace containing the syntactic forms of
@schememodname[r5rs], not including @scheme[#%module-begin] (which is
not useful outside of a module).}
The @scheme[scheme-null-environment] function returns a namespace
containing the syntactic forms of @schememodname[r5rs], not including
@scheme[#%module-begin] (which is not useful outside of a module).
@; ----------------------------------------
@ -194,12 +191,228 @@ importing @schememodname[r5rs/init].
@; ----------------------------------------
@(bibliography
@(define (redirects)
(make-binding-redirect-elements
'r5rs
(map (lambda (b)
(list (string->symbol (car b))
(cadr b)
(build-path 'up "r5rs-std" (caddr b))
(cadddr b)))
bindings)))
(bib-entry #:key "Kelsey98"
#:author "Richard Kelsey, William Clinger, and Jonathan Rees (editors)"
#:title @elem{The Revised@superscript{5} Report on the Algorithmic Language Scheme}
#:date "1998"
#:url "http://schemers.org/Documents/Standards/R5RS/")
@; This list was extracted from the old "keywords" and "hdindex" files:
@(define bindings
'(("lambda" #t "r5rs-Z-H-7.html" "%_idx_96")
("set!" #t "r5rs-Z-H-7.html" "%_idx_104")
("quote" #t "r5rs-Z-H-7.html" "%_idx_86")
("quasiquote" #t "r5rs-Z-H-7.html" "%_idx_154")
("or" #t "r5rs-Z-H-7.html" "%_idx_122")
("and" #t "r5rs-Z-H-7.html" "%_idx_120")
("define" #t "r5rs-Z-H-8.html" "%_idx_194")
("define-syntax" #t "r5rs-Z-H-8.html" "%_idx_202")
("let" #t "r5rs-Z-H-7.html" "%_idx_126")
("let*" #t "r5rs-Z-H-7.html" "%_idx_130")
("let-syntax" #t "r5rs-Z-H-7.html" "%_idx_184")
("letrec" #t "r5rs-Z-H-7.html" "%_idx_134")
("letrec-syntax" #t "r5rs-Z-H-7.html" "%_idx_186")
("cond" #t "r5rs-Z-H-7.html" "%_idx_108")
("delay" #t "r5rs-Z-H-7.html" "%_idx_146")
("do" #t "r5rs-Z-H-7.html" "%_idx_140")
("if" #t "r5rs-Z-H-7.html" "%_idx_98")
("case" #t "r5rs-Z-H-7.html" "%_idx_116")
("begin" #t "r5rs-Z-H-7.html" "%_idx_138")
)
("zero?" #f "r5rs-Z-H-9.html" "%_idx_268")
("write-char" #f "r5rs-Z-H-9.html" "%_idx_666")
;; ("write-char" #f "r5rs-Z-H-9.html" "%_idx_664")
("write" #f "r5rs-Z-H-9.html" "%_idx_654")
;; ("write" #f "r5rs-Z-H-9.html" "%_idx_652")
("with-output-to-file" #f "r5rs-Z-H-9.html" "%_idx_624")
("with-input-from-file" #f "r5rs-Z-H-9.html" "%_idx_622")
("vector?" #f "r5rs-Z-H-9.html" "%_idx_556")
("vector-set!" #f "r5rs-Z-H-9.html" "%_idx_568")
("vector-ref" #f "r5rs-Z-H-9.html" "%_idx_566")
("vector-length" #f "r5rs-Z-H-9.html" "%_idx_564")
("vector-fill!" #f "r5rs-Z-H-9.html" "%_idx_574")
("vector->list" #f "r5rs-Z-H-9.html" "%_idx_570")
("vector" #f "r5rs-Z-H-9.html" "%_idx_562")
("values" #f "r5rs-Z-H-9.html" "%_idx_594")
("truncate" #f "r5rs-Z-H-9.html" "%_idx_318")
("transcript-on" #f "r5rs-Z-H-9.html" "%_idx_670")
("transcript-off" #f "r5rs-Z-H-9.html" "%_idx_672")
("tan" #f "r5rs-Z-H-9.html" "%_idx_334")
("symbol?" #f "r5rs-Z-H-9.html" "%_idx_460")
("symbol->string" #f "r5rs-Z-H-9.html" "%_idx_462")
("substring" #f "r5rs-Z-H-9.html" "%_idx_542")
("string?" #f "r5rs-Z-H-9.html" "%_idx_508")
("string>?" #f "r5rs-Z-H-9.html" "%_idx_528")
("string>=?" #f "r5rs-Z-H-9.html" "%_idx_532")
("string=?" #f "r5rs-Z-H-9.html" "%_idx_522")
("string<?" #f "r5rs-Z-H-9.html" "%_idx_526")
("string<=?" #f "r5rs-Z-H-9.html" "%_idx_530")
("string-set!" #f "r5rs-Z-H-9.html" "%_idx_520")
("string-ref" #f "r5rs-Z-H-9.html" "%_idx_518")
("string-length" #f "r5rs-Z-H-9.html" "%_idx_516")
("string-fill!" #f "r5rs-Z-H-9.html" "%_idx_552")
("string-copy" #f "r5rs-Z-H-9.html" "%_idx_550")
("string-ci>?" #f "r5rs-Z-H-9.html" "%_idx_536")
("string-ci>=?" #f "r5rs-Z-H-9.html" "%_idx_540")
("string-ci=?" #f "r5rs-Z-H-9.html" "%_idx_524")
("string-ci<?" #f "r5rs-Z-H-9.html" "%_idx_534")
("string-ci<=?" #f "r5rs-Z-H-9.html" "%_idx_538")
("string-append" #f "r5rs-Z-H-9.html" "%_idx_544")
("string->symbol" #f "r5rs-Z-H-9.html" "%_idx_464")
("string->number" #f "r5rs-Z-H-9.html" "%_idx_370")
;; ("string->number" #f "r5rs-Z-H-9.html" "%_idx_368")
("string->list" #f "r5rs-Z-H-9.html" "%_idx_546")
("string" #f "r5rs-Z-H-9.html" "%_idx_514")
("sqrt" #f "r5rs-Z-H-9.html" "%_idx_344")
("sin" #f "r5rs-Z-H-9.html" "%_idx_330")
("set-cdr!" #f "r5rs-Z-H-9.html" "%_idx_418")
("set-car!" #f "r5rs-Z-H-9.html" "%_idx_416")
("scheme-report-environment" #f "r5rs-Z-H-9.html" "%_idx_602")
("round" #f "r5rs-Z-H-9.html" "%_idx_320")
("reverse" #f "r5rs-Z-H-9.html" "%_idx_440")
("remainder" #f "r5rs-Z-H-9.html" "%_idx_302")
("real?" #f "r5rs-Z-H-9.html" "%_idx_248")
("real-part" #f "r5rs-Z-H-9.html" "%_idx_352")
("read-char" #f "r5rs-Z-H-9.html" "%_idx_640")
;; ("read-char" #f "r5rs-Z-H-9.html" "%_idx_638")
("read" #f "r5rs-Z-H-9.html" "%_idx_636")
;; ("read" #f "r5rs-Z-H-9.html" "%_idx_634")
("rationalize" #f "r5rs-Z-H-9.html" "%_idx_322")
("rational?" #f "r5rs-Z-H-9.html" "%_idx_250")
("quotient" #f "r5rs-Z-H-9.html" "%_idx_300")
("procedure?" #f "r5rs-Z-H-9.html" "%_idx_576")
("positive?" #f "r5rs-Z-H-9.html" "%_idx_270")
("peek-char" #f "r5rs-Z-H-9.html" "%_idx_644")
;; ("peek-char" #f "r5rs-Z-H-9.html" "%_idx_642")
("pair?" #f "r5rs-Z-H-9.html" "%_idx_406")
("output-port?" #f "r5rs-Z-H-9.html" "%_idx_616")
("open-output-file" #f "r5rs-Z-H-9.html" "%_idx_628")
("open-input-file" #f "r5rs-Z-H-9.html" "%_idx_626")
("odd?" #f "r5rs-Z-H-9.html" "%_idx_274")
("numerator" #f "r5rs-Z-H-9.html" "%_idx_310")
("number?" #f "r5rs-Z-H-9.html" "%_idx_244")
("number->string" #f "r5rs-Z-H-9.html" "%_idx_366")
;; ("number->string" #f "r5rs-Z-H-9.html" "%_idx_364")
("null?" #f "r5rs-Z-H-9.html" "%_idx_428")
("null-environment" #f "r5rs-Z-H-9.html" "%_idx_604")
("not" #f "r5rs-Z-H-9.html" "%_idx_386")
("newline" #f "r5rs-Z-H-9.html" "%_idx_662")
;; ("newline" #f "r5rs-Z-H-9.html" "%_idx_660")
("negative?" #f "r5rs-Z-H-9.html" "%_idx_272")
("modulo" #f "r5rs-Z-H-9.html" "%_idx_304")
("min" #f "r5rs-Z-H-9.html" "%_idx_280")
("memv" #f "r5rs-Z-H-9.html" "%_idx_448")
("memq" #f "r5rs-Z-H-9.html" "%_idx_446")
("member" #f "r5rs-Z-H-9.html" "%_idx_450")
("max" #f "r5rs-Z-H-9.html" "%_idx_278")
("map" #f "r5rs-Z-H-9.html" "%_idx_580")
("make-vector" #f "r5rs-Z-H-9.html" "%_idx_560")
;; ("make-vector" #f "r5rs-Z-H-9.html" "%_idx_558")
("make-string" #f "r5rs-Z-H-9.html" "%_idx_512")
;; ("make-string" #f "r5rs-Z-H-9.html" "%_idx_510")
("make-rectangular" #f "r5rs-Z-H-9.html" "%_idx_348")
("make-polar" #f "r5rs-Z-H-9.html" "%_idx_350")
("magnitude" #f "r5rs-Z-H-9.html" "%_idx_356")
("log" #f "r5rs-Z-H-9.html" "%_idx_328")
("load" #f "r5rs-Z-H-9.html" "%_idx_668")
("list?" #f "r5rs-Z-H-9.html" "%_idx_432")
("list-tail" #f "r5rs-Z-H-9.html" "%_idx_442")
("list-ref" #f "r5rs-Z-H-9.html" "%_idx_444")
("list->vector" #f "r5rs-Z-H-9.html" "%_idx_572")
("list->string" #f "r5rs-Z-H-9.html" "%_idx_548")
("list" #f "r5rs-Z-H-9.html" "%_idx_434")
("length" #f "r5rs-Z-H-9.html" "%_idx_436")
("lcm" #f "r5rs-Z-H-9.html" "%_idx_308")
("interaction-environment" #f "r5rs-Z-H-9.html" "%_idx_606")
("integer?" #f "r5rs-Z-H-9.html" "%_idx_252")
("integer->char" #f "r5rs-Z-H-9.html" "%_idx_500")
("input-port?" #f "r5rs-Z-H-9.html" "%_idx_614")
("inexact?" #f "r5rs-Z-H-9.html" "%_idx_256")
("inexact->exact" #f "r5rs-Z-H-9.html" "%_idx_362")
("imag-part" #f "r5rs-Z-H-9.html" "%_idx_354")
("gcd" #f "r5rs-Z-H-9.html" "%_idx_306")
("force" #f "r5rs-Z-H-9.html" "%_idx_584")
("for-each" #f "r5rs-Z-H-9.html" "%_idx_582")
("floor" #f "r5rs-Z-H-9.html" "%_idx_314")
("expt" #f "r5rs-Z-H-9.html" "%_idx_346")
("exp" #f "r5rs-Z-H-9.html" "%_idx_326")
("exact?" #f "r5rs-Z-H-9.html" "%_idx_254")
("exact->inexact" #f "r5rs-Z-H-9.html" "%_idx_360")
("even?" #f "r5rs-Z-H-9.html" "%_idx_276")
("eval" #f "r5rs-Z-H-9.html" "%_idx_600")
("eqv?" #f "r5rs-Z-H-9.html" "%_idx_214")
("equal?" #f "r5rs-Z-H-9.html" "%_idx_222")
("eq?" #f "r5rs-Z-H-9.html" "%_idx_220")
("eof-object?" #f "r5rs-Z-H-9.html" "%_idx_646")
("dynamic-wind" #f "r5rs-Z-H-9.html" "%_idx_598")
("display" #f "r5rs-Z-H-9.html" "%_idx_658")
;; ("display" #f "r5rs-Z-H-9.html" "%_idx_656")
("denominator" #f "r5rs-Z-H-9.html" "%_idx_312")
("current-output-port" #f "r5rs-Z-H-9.html" "%_idx_620")
("current-input-port" #f "r5rs-Z-H-9.html" "%_idx_618")
("cos" #f "r5rs-Z-H-9.html" "%_idx_332")
("cons" #f "r5rs-Z-H-9.html" "%_idx_408")
("complex?" #f "r5rs-Z-H-9.html" "%_idx_246")
("close-output-port" #f "r5rs-Z-H-9.html" "%_idx_632")
("close-input-port" #f "r5rs-Z-H-9.html" "%_idx_630")
("char?" #f "r5rs-Z-H-9.html" "%_idx_466")
("char>?" #f "r5rs-Z-H-9.html" "%_idx_472")
("char>=?" #f "r5rs-Z-H-9.html" "%_idx_476")
("char=?" #f "r5rs-Z-H-9.html" "%_idx_468")
("char<?" #f "r5rs-Z-H-9.html" "%_idx_470")
("char<=?" #f "r5rs-Z-H-9.html" "%_idx_474")
("char-whitespace?" #f "r5rs-Z-H-9.html" "%_idx_492")
("char-upper-case?" #f "r5rs-Z-H-9.html" "%_idx_494")
("char-upcase" #f "r5rs-Z-H-9.html" "%_idx_502")
("char-ready?" #f "r5rs-Z-H-9.html" "%_idx_650")
;; ("char-ready?" #f "r5rs-Z-H-9.html" "%_idx_648")
("char-numeric?" #f "r5rs-Z-H-9.html" "%_idx_490")
("char-lower-case?" #f "r5rs-Z-H-9.html" "%_idx_496")
("char-downcase" #f "r5rs-Z-H-9.html" "%_idx_504")
("char-ci>?" #f "r5rs-Z-H-9.html" "%_idx_482")
("char-ci>=?" #f "r5rs-Z-H-9.html" "%_idx_486")
("char-ci=?" #f "r5rs-Z-H-9.html" "%_idx_478")
("char-ci<?" #f "r5rs-Z-H-9.html" "%_idx_480")
("char-ci<=?" #f "r5rs-Z-H-9.html" "%_idx_484")
("char-alphabetic?" #f "r5rs-Z-H-9.html" "%_idx_488")
("char->integer" #f "r5rs-Z-H-9.html" "%_idx_498")
("ceiling" #f "r5rs-Z-H-9.html" "%_idx_316")
("cdr" #f "r5rs-Z-H-9.html" "%_idx_414")
("cddddr" #f "r5rs-Z-H-9.html" "%_idx_426")
("cdddar" #f "r5rs-Z-H-9.html" "%_idx_424")
("car" #f "r5rs-Z-H-9.html" "%_idx_410")
("call-with-values" #f "r5rs-Z-H-9.html" "%_idx_596")
("call-with-output-file" #f "r5rs-Z-H-9.html" "%_idx_612")
("call-with-input-file" #f "r5rs-Z-H-9.html" "%_idx_610")
("call-with-current-continuation" #f "r5rs-Z-H-9.html" "%_idx_588")
("cadr" #f "r5rs-Z-H-9.html" "%_idx_422")
("caar" #f "r5rs-Z-H-9.html" "%_idx_420")
("boolean?" #f "r5rs-Z-H-9.html" "%_idx_388")
("atan" #f "r5rs-Z-H-9.html" "%_idx_342")
;; ("atan" #f "r5rs-Z-H-9.html" "%_idx_340")
("assv" #f "r5rs-Z-H-9.html" "%_idx_454")
("assq" #f "r5rs-Z-H-9.html" "%_idx_452")
("assoc" #f "r5rs-Z-H-9.html" "%_idx_456")
("asin" #f "r5rs-Z-H-9.html" "%_idx_336")
("apply" #f "r5rs-Z-H-9.html" "%_idx_578")
("append" #f "r5rs-Z-H-9.html" "%_idx_438")
("angle" #f "r5rs-Z-H-9.html" "%_idx_358")
("acos" #f "r5rs-Z-H-9.html" "%_idx_338")
("abs" #f "r5rs-Z-H-9.html" "%_idx_298")
(">=" #f "r5rs-Z-H-9.html" "%_idx_266")
(">" #f "r5rs-Z-H-9.html" "%_idx_262")
("=" #f "r5rs-Z-H-9.html" "%_idx_258")
("<=" #f "r5rs-Z-H-9.html" "%_idx_264")
("<" #f "r5rs-Z-H-9.html" "%_idx_260")
("/" #f "r5rs-Z-H-9.html" "%_idx_296")
;;("/" #f "r5rs-Z-H-9.html" "%_idx_294")
;;("/" #f "r5rs-Z-H-9.html" "%_idx_292")
("-" #f "r5rs-Z-H-9.html" "%_idx_290")
;;("-" #f "r5rs-Z-H-9.html" "%_idx_288")
;;("-" #f "r5rs-Z-H-9.html" "%_idx_286")
("+" #f "r5rs-Z-H-9.html" "%_idx_282")
("*" #f "r5rs-Z-H-9.html" "%_idx_284")))

View File

@ -80,7 +80,7 @@
(error 'help
"no documentation found for: ~e provided by: ~a"
(syntax-e id)
(module-path-index-resolve (caddr b)))))
(module-path-index-resolve (caddr (or lb b))))))
(search-for-exports xref (syntax-e id)))))
(define (search-for-exports xref sym)

View File

@ -111,10 +111,16 @@
(unless (null? parts)
(let ([s (car parts)])
(collect-part s d p-ci
(cons (if (unnumbered-part? s) #f pos)
(cons (if (or (unnumbered-part? s)
(part-style? s 'unnumbered))
#f
pos)
number))
(loop (cdr parts)
(if (unnumbered-part? s) pos (add1 pos))))))
(if (or (unnumbered-part? s)
(part-style? s 'unnumbered))
pos
(add1 pos))))))
(let ([prefix (part-tag-prefix d)])
(for ([(k v) (collect-info-ht p-ci)])
(when (cadr k)

View File

@ -9,6 +9,7 @@
setup/main-collects
mzlib/list
net/url
scheme/serialize
(prefix-in xml: xml/xml)
(for-syntax scheme/base))
(provide render-mixin
@ -49,23 +50,27 @@
;; (i.e., the ones that are not allowed as-in in URI
;; codecs) by using "~" followed by a hex encoding.
(define (anchor-name v)
(let loop ([s (format "~a" v)])
(cond
[(regexp-match-positions #rx"[A-Z.]" s)
=> (lambda (m)
(string-append
(loop (substring s 0 (caar m)))
"."
(substring s (caar m) (cdar m))
(loop (substring s (cdar m)))))]
[(regexp-match-positions #rx"[^-a-zA-Z0-9_!*'().]" s)
=> (lambda (m)
(string-append
(substring s 0 (caar m))
"~"
(format "~x" (char->integer (string-ref s (caar m))))
(loop (substring s (cdar m)))))]
[else s])))
(if (literal-anchor? v)
(literal-anchor-string v)
(let loop ([s (format "~a" v)])
(cond
[(regexp-match-positions #rx"[A-Z.]" s)
=> (lambda (m)
(string-append
(loop (substring s 0 (caar m)))
"."
(substring s (caar m) (cdar m))
(loop (substring s (cdar m)))))]
[(regexp-match-positions #rx"[^-a-zA-Z0-9_!*'().]" s)
=> (lambda (m)
(string-append
(substring s 0 (caar m))
"~"
(format "~x" (char->integer (string-ref s (caar m))))
(loop (substring s (cdar m)))))]
[else s]))))
(define-serializable-struct literal-anchor (string))
(define literal
(let ([loc (xml:make-location 0 0 0)])
@ -229,10 +234,18 @@
(let ([key (generate-tag (target-element-tag i) ci)])
(collect-put! ci
key
(vector (path->relative (current-output-file))
#f
(vector (path->relative (let ([p (current-output-file)])
(if (redirect-target-element? i)
(let-values ([(base name dir?) (split-path p)])
(build-path
base
(redirect-target-element-alt-path i)))
p)))
#f
(page-target-element? i)
key))))
(if (redirect-target-element? i)
(make-literal-anchor (redirect-target-element-alt-anchor i))
key)))))
(define (dest-path dest)
(if (vector? dest) ; temporary

View File

@ -68,7 +68,8 @@
(if no-number?
"*"
""))
(when (not (part-style? d 'hidden))
(when (not (or (part-style? d 'hidden)
no-number?))
(printf "[")
(parameterize ([disable-images #t])
(render-content (part-title-content d) d ri))

View File

@ -437,6 +437,55 @@
(lambda () (car content))
(lambda () (car content))))))
(define (make-binding-redirect-elements mod-path redirects)
(let ([taglet (path->main-collects-relative
(resolved-module-path-name
(module-path-index-resolve
(module-path-index-join mod-path #f))))])
(make-element
#f
(map
(lambda (redirect)
(let ([id (car redirect)]
[form? (cadr redirect)]
[path (caddr redirect)]
[anchor (cadddr redirect)])
(let ([make-one
(lambda (kind)
(make-redirect-target-element
#f
null
(list kind (list taglet id))
path
anchor))])
(make-element
#f
(list (make-one (if form? 'form 'def))
(make-one 'dep)
(make-index-element #f
null
(list (if form? 'form 'def)
(list taglet id))
(list (symbol->string id))
(list
(make-element
"schemesymbol"
(list
(make-element
(if form?
"schemesyntaxlink"
"schemevaluelink")
(list (symbol->string id))))))
((if form?
make-form-index-desc
make-procedure-index-desc)
id
(list mod-path))))))))
redirects))))
(provide make-binding-redirect-elements)
(define current-signature (make-parameter #f))
(define-syntax-rule (sigelem sig elem)

View File

@ -159,6 +159,8 @@
[(target-element element) ([tag tag?])]
[(toc-target-element target-element) ()]
[(page-target-element target-element) ()]
[(redirect-target-element target-element) ([alt-path path-string?]
[alt-anchor string?])]
[(link-element element) ([tag tag?])]
[(index-element element) ([tag tag?]
[plain-seq (listof string?)]

3
collects/srfi/info.ss Normal file
View File

@ -0,0 +1,3 @@
#lang setup/infotab
(define scribblings '(("srfi.scrbl" (multi-page))))

898
collects/srfi/srfi.scrbl Normal file
View File

@ -0,0 +1,898 @@
#lang scribble/doc
@(require scribble/manual
(for-syntax scheme/base))
@(define-syntax (srfi stx)
(syntax-case stx ()
[(_ num #:subdir dir . title)
(with-syntax ([srfi/n (string->symbol
(format "srfi/~a" (syntax-e #'num)))])
#'(begin
(section #:tag (format "srfi-~a" num)
#:style 'unnumbered
(format "SRFI ~a: " num)
. title)
(defmodule srfi/n)
"Original specification: " @link[(format "../srfi-std/~asrfi-~a.html" dir num)
"SRFI "
(number->string num)]))]
[(_ num . title) #'(srfi num #:subdir "" . title)]))
@;{ The `lst' argument is a list of
(list sym syntactic-form? html-anchor) }
@(define (redirect n lst)
(let ([file (format "srfi-~a.html" n)]
[mod-path (string->symbol (format "srfi/~a" n))])
(make-binding-redirect-elements mod-path
(map (lambda (b)
(list (car b) (cadr b)
(build-path 'up "srfi-std" file)
(caddr b)))
lst))))
@(define in-core
(case-lambda
[() (in-core ".")]
[(k)
@elem{This SRFI's bindings are also available in @schememodname[scheme/base]@|k|}]))
@; ----------------------------------------------------------------------
@title{@bold{SRFIs}: Libraries}
The @link["http://srfi.schemers.org/"]{Scheme Requests for
Implementation} (a.k.a. @deftech{SRFI}) process allows the Scheme
community as a whole to propose extensions of Scheme to be supported
by multiple implementations.
PLT Scheme is distributed with implementations of many SRFIs, most of
which can be implemented as libraries. To import the bindings of SRFI
@math{n}, use
@schemeblock[
(require #, @elem{@schemeidfont{srfi/}@math{n}})
]
This document lists the SRFIs that are supported by PLT Scheme and
provides a link to the original SRFI specification (which is also
distributed as part of PLT Scheme's documentation).
@table-of-contents[]
@; ----------------------------------------
@srfi[1]{List Library}
@redirect[1 '(
(cons #f "cons")
(list #f "list")
(xcons #f "xcons")
(cons* #f "cons*")
(make-list #f "make-list")
(list-tabulate #f "list-tabulate")
(list-copy #f "list-copy")
(circular-list #f "circular-list")
(iota #f "iota")
(pair? #f "pair-p")
(null? #f "null-p")
(proper-list? #f "proper-list-p")
(circular-list? #f "circular-list-p")
(dotted-list? #f "dotted-list-p")
(not-pair? #f "not-pair-p")
(null-list? #f "null-list-p")
(car #f "car")
(cdr #f "cdr")
(cddadr #f "cddadr")
(cddddr #f "cddddr")
(list-ref #f "list-ref")
(first #f "first")
(second #f "second")
(third #f "third")
(fourth #f "fourth")
(fifth #f "fifth")
(sixth #f "sixth")
(seventh #f "seventh")
(eighth #f "eighth")
(ninth #f "ninth")
(tenth #f "tenth")
(car+cdr #f "car+cdr")
(take #f "take")
(drop #f "drop")
(take-right #f "take-right")
(drop-right #f "drop-right")
(take! #f "take!")
(drop-right! #f "drop-right!")
(split-at #f "split-at")
(split-at! #f "split-at!")
(last #f "last")
(last-pair #f "last-pair")
(length #f "length")
(length+ #f "length+")
(append #f "append")
(append! #f "append!")
(concatenate #f "concatenate")
(concatenate! #f "concatenate!")
(reverse #f "reverse")
(reverse! #f "srfi-1.html")
(append-reverse #f "append-reverse")
(append-reverse! #f "append-reverse!")
(zip #f "zip")
(unzip1 #f "unzip1")
(unzip2 #f "unzip2")
(unzip3 #f "unzip3")
(unzip4 #f "unzip4")
(unzip5 #f "unzip5")
(count #f "count")
(fold #f "fold")
(fold-right #f "fold-right")
(pair-fold #f "pair-fold")
(pair-fold-right #f "pair-fold-right")
(reduce #f "reduce")
(reduce-right #f "reduce-right")
(unfold #f "unfold")
(map #f "map")
(for-each #f "srfi-1.html")
(append-map #f "append-map")
(append-map! #f "append-map!")
(map! #f "map!")
(map-in-order #f "map-in-order")
(pair-for-each #f "pair-for-each")
(filter-map #f "filter-map")
(filter #f "filter")
(filter! #f "filter!")
(partition! #f "partition!")
(remove! #f "remove!")
(remove #f "remove")
(partition #f "partition")
(find #f "find")
(find-tail #f "find-tail")
(take-while #f "take-while")
(take-while! #f "take-while!")
(drop-while #f "drop-while")
(span #f "span")
(span! #f "span!")
(break #f "break")
(break! #f "break!")
(any #f "any")
(every #f "every")
(list-index #f "list-index")
(member #f "member")
(memq #f "memq")
(memv #f "memv")
(delete #f "delete")
(delete-duplicates #f "delete-duplicates")
(delete! #f "delete!")
(delete-duplicates! #f "delete-duplicates!")
(assoc #f "assoc")
(assq #f "assq")
(assv #f "assv")
(alist-cons #f "alist-cons")
(alist-copy #f "alist-copy")
(alist-delete #f "alist-delete")
(alist-delete! #f "alist-delete!")
(lset #f "lset")
(lset= #f "lset=")
(lset-adjoin #f "lset-adjoin")
(lset-union #f "lset-union")
(lset-intersection #f "lset-intersection")
(lset-intersection! #f "lset-intersection!")
(lset-union! #f "lset-union!")
(lset-difference! #f "lset-difference!")
(lset-xor! #f "lset-xor!")
(lset-diff+intersection! #f "lset-diff+intersection!")
(lset-difference #f "lset-difference")
(lset-xor #f "lset-xor")
(lset-diff+intersection #f "lset-diff+intersection")
(set-car! #f "set-car!")
(set-cdr! #f "set-cdr!")
)]
@; ----------------------------------------
@srfi[2]{AND-LET*: an AND with local bindings...}
@redirect[2 '(
(and-let* #t "and-let")
)]
@; ----------------------------------------
@srfi[4]{Homogeneous numeric vector datatypes}
@redirect[4 '(
(s8vector #f "s8vector")
(u8vector #f "s8vector")
(s16vector #f "s8vector")
(u16vector #f "u8vector")
(s32vector #f "s16vector")
(u32vector #f "u16vector")
(s64vector #f "s64vector")
(u64vector #f "u64vector")
(f32vector #f "f32vector")
(f64vector #f "f64vector")
)]
This SRFI's reader and printer syntax is not supported. The bindings
are also available from @schememodname[scheme/foreign].
@; ----------------------------------------
@srfi[5]{A compatible let form with signatures and rest arguments}
@redirect[5 '(
(let #t "unnamed")
)]
@; ----------------------------------------
@srfi[6]{Basic String Ports}
@redirect[6 '(
(open-input-string #f "open-input-string")
(open-output-string #f "open-output-string")
(get-output-string #f "get-output-string")
)]
@in-core[]
@; ----------------------------------------
@srfi[7]{Feature-based program configuration language}
@redirect[7 '(
(program #t "program")
)]
@; ----------------------------------------
@srfi[8]{RECEIVE: Binding to multiple values}
@redirect[8 '(
(receive #t "receive")
)]
@; ----------------------------------------
@srfi[9]{Defining Record Types}
@redirect[9 '(
(define-record-type #t "define-record-type")
)]
@; ----------------------------------------
@srfi[11]{Syntax for receiving multiple values}
@redirect[11 '(
(let-values #t "let-values")
(let*-values #t "let*-values")
)]
@in-core{, but without support for dotted ``rest'' bindings.}
@; ----------------------------------------
@srfi[13]{String Libraries}
@redirect[13 '(
(string? #f "string-p")
(string-null? #f "string-null-p")
(string-every #f "string-every")
(string-any #f "string-any")
(make-string #f "make-string")
(string #f "string")
(string-tabulate #f "string-tabulate")
(string->list #f "string2list")
(list->string #f "list2string")
(reverse-list->string #f "reverse-list2string")
(string-join #f "string-join")
(string-length #f "string-length")
(string-ref #f "string-ref")
(string-copy #f "string-copy")
(substring/shared #f "substring/shared")
(string-copy! #f "string-copy!")
(string-take #f "string-take")
(string-drop #f "string-drop")
(string-take-right #f "string-take-right")
(string-drop-right #f "string-drop-right")
(string-pad #f "string-pad")
(string-pad-right #f "string-pad-right")
(string-trim #f "string-trim")
(string-trim-right #f "string-trim-right")
(string-trim-both #f "string-trim-both")
(string-set! #f "string-set!")
(string-fill! #f "string-fill!")
(string-compare #f "string-compare")
(string-compare-ci #f "string-compare-ci")
(string= #f "string=")
(string<> #f "string<>")
(string< #f "string<")
(string> #f "string>")
(string<= #f "string<=")
(string>= #f "string>=")
(string-ci= #f "string-ci=")
(string-ci<> #f "string-ci<>")
(string-ci< #f "string-ci<")
(string-ci> #f "string-ci>")
(string-ci<= #f "string-ci<=")
(string-ci>= #f "string-ci>=")
(string-hash #f "string-hash")
(string-hash-ci #f "string-hash-ci")
(string-prefix-length #f "string-prefix-length")
(string-suffix-length #f "string-suffix-length")
(string-prefix-length-ci #f "string-prefix-length-ci")
(string-suffix-length-ci #f "string-suffix-length-ci")
(string-prefix? #f "string-prefix-p")
(string-suffix? #f "string-suffix-p")
(string-prefix-ci? #f "string-prefix-ci-p")
(string-suffix-ci? #f "string-suffix-ci-p")
(string-index #f "string-index")
(string-index-right #f "string-index-right")
(string-skip #f "string-skip")
(string-skip-right #f "string-skip-right")
(string-count #f "string-count")
(string-contains #f "string-contains")
(string-contains-ci #f "string-contains-ci")
(string-titlecase #f "string-titlecase")
(string-titlecase! #f "string-titlecase!")
(string-upcase #f "string-upcase")
(string-upcase! #f "string-upcase!")
(string-downcase #f "string-downcase")
(string-downcase! #f "string-downcase!")
(string-reverse #f "string-reverse")
(string-reverse! #f "string-reverse!")
(string-append #f "string-append")
(string-concatenate #f "string-concatenate")
(string-concatenate/shared #f "string-concatenate/shared")
(string-append/shared #f "string-append/shared")
(string-concatenate-reverse #f "string-concatenate-reverse")
(string-concatenate-reverse/shared #f "string-concatenate-reverse/shared")
(string-map #f "string-map")
(string-map! #f "string-map!")
(string-fold #f "string-fold")
(string-fold-right #f "string-fold-right")
(string-unfold #f "string-unfold")
(string-unfold-right #f "string-unfold-right")
(string-for-each #f "string-for-each")
(string-for-each-index #f "string-for-each-index")
(xsubstring #f "xsubstring")
(string-xcopy! #f "string-xcopy!")
(string-replace #f "string-replace")
(string-tokenize #f "string-tokenize")
(string-filter #f "string-filter")
(string-delete #f "string-delete")
(string-parse-start+end #f "string-parse-start+end")
(string-parse-final-start+end #f "string-parse-final-start+end")
(let-string-start+end #f "let-string-start+end")
(check-substring-spec #f "check-substring-spec")
(substring-spec-ok? #f "substring-spec-ok-p")
(make-kmp-restart-vector #f "make-kmp-restart-vector")
(kmp-step #f "kmp-step")
(string-kmp-partial-search #f "string-kmp-partial-search")
)]
@; ----------------------------------------
@srfi[14]{Character-set Library}
@redirect[14 '(
(char-set? #f "char-set-p")
(char-set= #f "char-set=")
(char-set<= #f "char-set<=")
(char-set-hash #f "char-set-hash")
(char-set-cursor #f "char-set-cursor")
(char-set-ref #f "char-set-ref")
(char-set-cursor-next #f "char-set-cursor-next")
(end-of-char-set? #f "end-of-char-set-p")
(char-set-fold #f "char-set-fold")
(char-set-unfold #f "char-set-unfold")
(char-set-unfold! #f "char-set-unfold!")
(char-set-for-each #f "char-set-for-each")
(char-set-map #f "char-set-map")
(char-set-copy #f "char-set-copy")
(char-set #f "char-set")
(list->char-set #f "list->char-set")
(list->char-set! #f "list->char-set!")
(string->char-set #f "string->char-set")
(string->char-set! #f "string->char-set!")
(char-set-filter #f "char-set-filter")
(char-set-filter! #f "char-set-filter!")
(ucs-range->char-set #f "ucs-range->char-set")
(ucs-range->char-set! #f "ucs-range->char-set!")
(->char-set #f "->char-set")
(char-set->list #f "char-set->list")
(char-set->string #f "char-set->string")
(char-set-size #f "char-set-size")
(char-set-count #f "char-set-count")
(char-set-every #f "char-set-every")
(char-set-any #f "char-set-any")
(char-set-contains? #f "char-set-contains-p")
(char-set-adjoin #f "char-set-adjoin")
(char-set-delete #f "char-set-delete")
(char-set-adjoin! #f "char-set-adjoin!")
(char-set-delete! #f "char-set-delete!")
(char-set-complement #f "char-set-complement")
(char-set-union #f "char-set-union")
(char-set-intersection #f "char-set-intersection")
(char-set-difference #f "char-set-difference")
(char-set-xor #f "char-set-xor")
(char-set-diff+intersection #f "char-set-diff+intersection")
(char-set-complement! #f "char-set-complement!")
(char-set-union! #f "char-set-union!")
(char-set-intersection! #f "char-set-intersection!")
(char-set-difference! #f "char-set-difference!")
(char-set-xor! #f "char-set-xor!")
(char-set-diff+intersection! #f "char-set-diff+intersection!")
(char-set:lower-case #f "char-set:lower-case")
(char-set:upper-case #f "char-set:upper-case")
(char-set:title-case #f "char-set:title-case")
(char-set:letter #f "char-set:letter")
(char-set:digit #f "char-set:digit")
(char-set:letter+digit #f "char-set:letter+digit")
(char-set:graphic #f "char-set:graphic")
(char-set:printing #f "char-set:printing")
(char-set:whitespace #f "char-set:whitespace")
(char-set:iso-control #f "char-set:iso-control")
(char-set:punctuation #f "char-set:punctuation")
(char-set:symbol #f "char-set:symbol")
(char-set:hex-digit #f "char-set:hex-digit")
(char-set:blank #f "char-set:blank")
(char-set:ascii #f "char-set:ascii")
(char-set:empty #f "char-set:empty")
(char-set:full #f "char-set:full")
)]
@; ----------------------------------------
@srfi[16]{Syntax for procedures of variable arity}
@redirect[16 '(
(case-lambda #t "case-lambda")
)]
@in-core[]
@; ----------------------------------------
@srfi[17]{Generalized set!}
@redirect[17 '(
(set! #t "set!")
(getter-with-setter #f "getter-with-setter")
)]
@; ----------------------------------------
@srfi[19]{Time Data Types and Procedures}
@redirect[19 '(
(time-duration #f "")
(time-monotonic #f "time-monotonic")
(time-process #f "time-process")
(time-tai #f "time-tai")
(time-thread #f "time-thread")
(time-utc #f "time-utc")
(current-date #f "")
(current-julian-day #f "current-julian-day")
(current-modified-julian-day #f "current-modified-julian-day")
(current-time #f "current-time")
(time-resolution #f "time-resolution")
(make-time #f "make-time")
(time? #f "time-p")
(time-type #f "time-type")
(time-nanosecond #f "time-nanosecond")
(time-second #f "time-second")
(set-time-type! #f "set-time-type!")
(set-time-nanosecond! #f "set-time-nanosecond!")
(set-time-second! #f "set-time-second!")
(copy-time #f "copy-time")
(time<=? #f "time<=-p")
(time<? #f "time<-p")
(time=? #f "time=-p")
(time>=? #f "time>=-p")
(time>? #f "time>-p")
(time-difference #f "time-difference")
(time-difference! #f "time-difference!")
(add-duration #f "add-duration")
(add-duration! #f "add-duration!")
(subtract-duration #f "subtract-duration")
(subtract-duration! #f "subtract-duration!")
(make-date #f "make-date")
(date? #f "date-p")
(date-nanosecond #f "date-nanosecond")
(date-second #f "date-second")
(date-minute #f "date-minute")
(date-hour #f "date-hour")
(date-day #f "date-day")
(date-month #f "date-month")
(date-year #f "date-year")
(date-zone-offset #f "date-zone-offset")
(date-year-day #f "date-year-day")
(date-week-day #f "date-week-day")
(date-week-number #f "date-week-number")
(date->julian-day #f "date->julian-day")
(date->modified-julian-day #f "date->modified-julian-day")
(date->time-monotonic #f "date->time-monotonic")
(date->time-tai #f "date->time-tai")
(date->time-utc #f "date->time-utc")
(julian-day->date #f "julian-day->date")
(julian-day->time-monotonic #f "julian-day->time-monotonic")
(julian-day->time-tai #f "julian-day->time-tai")
(julian-day->time-utc #f "julian-day->time-utc")
(modified-julian-day->date #f "modified-julian-day->date")
(modified-julian-day->time-monotonic #f "modified-julian-day->time-monotonic")
(modified-julian-day->time-tai #f "modified-julian-day->time-tai")
(modified-julian-day->time-utc #f "modified-julian-day->time-utc")
(time-monotonic->date #f "time-monotonic->date")
(time-monotonic->julian-day #f "time-monotonic->julian-day")
(time-monotonic->modified-julian-day #f "time-monotonic->modified-julian-day")
(time-monotonic->time-tai #f "time-monotonic->time-tai")
(time-monotonic->time-tai! #f "time-monotonic->time-tai!")
(time-monotonic->time-utc #f "time-monotonic->time-utc")
(time-monotonic->time-utc! #f "time-monotonic->time-utc!")
(time-tai->date #f "time-tai->date")
(time-tai->julian-day #f "time-tai->julian-day")
(time-tai->modified-julian-day #f "time-tai->modified-julian-day")
(time-tai->time-monotonic #f "time-tai->time-monotonic")
(time-tai->time-monotonic! #f "time-tai->time-monotonic!")
(time-tai->time-utc #f "time-tai->time-utc")
(time-tai->time-utc! #f "time-tai->time-utc!")
(time-utc->date #f "time-utc->date")
(time-utc->julian-day #f "time-utc->julian-day")
(time-utc->modified-julian-day #f "time-utc->modified-julian-day")
(time-utc->time-monotonic #f "time-utc->time-monotonic")
(time-utc->time-monotonic! #f "time-utc->time-monotonic!")
(time-utc->time-tai #f "time-utc->time-tai")
(time-utc->time-tai! #f "time-utc->time-tai!")
(date->string #f "date->string")
(string->date #f "string->date")
)]
Care most be taken NOT to confuse the internal date structure with the
PLT Scheme @scheme[date]; they are not the same, and all procedures
from the SRFI library expect the former.
@; ----------------------------------------
@srfi[23]{Error reporting mechanism}
@redirect[23 '(
(error #f "error")
)]
@in-core[]
@; ----------------------------------------
@srfi[25]{Multi-dimensional Array Primitives}
@redirect[25 '(
(array? #f "array-p")
(make-array #f "make-array")
(shape #f "shape")
(array #f "array")
(array-rank #f "array-rank")
(array-start #f "array-start")
(array-end #f "array-end")
(array-ref #f "array-ref")
(array-set! #f "array-set!")
(share-array #f "share-array")
)]
@; ----------------------------------------
@srfi[26]{Notation for Specializing Parameters without Currying}
@redirect[26 '(
(cut #t "cut")
(cute #t "cute")
)]
@; ----------------------------------------
@srfi[27]{Sources of Random Bits}
@redirect[27 '(
(random-integer #f "random-integer")
(random-real #f "random-real")
(default-random-source #f "default-random-source")
(make-random-source #f "make-random-source")
(random-source? #f "random-source-p")
(random-source-state-ref #f "random-source-state-ref")
(random-source-state-ref! #f "random-source-state-ref")
(random-source-randomize! #f "random-source-randomize!")
(random-source-pseudo-randomize! #f "random-source-pseudo-randomize!")
(random-source-make-integers #f "random-source-make-integers")
(random-source-make-reals #f "random-source-make-reals")
)]
@; ----------------------------------------
@srfi[28]{Basic Format Strings}
@redirect[28 '(
(format #f "format")
)]
@in-core[]
@; ----------------------------------------
@srfi[29]{Localization}
@redirect[29 '(
(current-language #f "current-language")
(current-country #f "current-country")
(current-locale-details #f "current-locale-details")
(declare-bundle! #f "declare-bundle!")
(store-bundle #f "store-bundle")
(load-bundle! #f "load-bundle!")
(localized-template #f "localized-template")
)]
@; ----------------------------------------
@srfi[30]{Nested Multi-line Comments}
This SRFI's syntax is part of PLT Scheme's default reader.
@; ----------------------------------------
@srfi[31]{A special form rec for recursive evaluation}
@redirect[31 '(
(rec #t "rec")
)]
@; ----------------------------------------
@srfi[34]{Exception Handling for Programs}
@redirect[34 '(
(with-exception-handler #f "with-exception-handler")
(guard #t "guard")
(raise #f "raise")
)]
@; ----------------------------------------
@srfi[35]{Conditions}
@; ----------------------------------------
@srfi[38]{External Representation for Data With Shared Structure}
@redirect[38 '(
(write-with-shared-structure #f "write-with-shared-structure")
(read-with-shared-structure #f "read-with-shared-structure")
)]
This SRFI's syntax is part of PLT Scheme's default reader and printer.
@; ----------------------------------------
@srfi[39]{Parameter objects}
@redirect[39 '(
(make-parameter #f "make-parameter")
(parameterize #t "parameterize")
)]
@in-core[]
@; ----------------------------------------
@srfi[40]{A Library of Streams}
@redirect[40 '(
(stream-cons #t "stream-cons")
(stream? #f "stream?")
(stream-null? #f "stream-null?")
(stream-car #f "stream-car")
(stream-cdr #f "stream-cdr")
(stream-delay #t "stream-delay")
(stream-null #f "stream-null")
(stream #f "stream")
(stream-unfoldn #f "stream-unfoldn")
(stream-map #f "stream-map")
(stream-for-each #f "stream-for-each")
(stream-filter #f "stream-filter")
)]
@; ----------------------------------------
@srfi[42]{Eager Comprehensions}
@redirect[42 '(
(do-ec #t "do-ec")
(list-ec #t "list-ec")
(append-ec #t "append-ec")
(string-ec #t "string-ec")
(string-append-ec #t "string-append-ec")
(vector-ec #t "vector-ec")
(vector-of-length-ec #t "vector-of-length-ec")
(sum-ec #t "sum-ec")
(product-ec #t "product-ec")
(min-ec #t "min-ec")
(max-ec #t "max-ec")
(any?-ec #t "any?-ec")
(every?-ec #t "every?-ec")
(first-ec #t "first-ec")
(last-ec #t "last-ec")
(fold-ec #t "fold-ec")
(fold3-ec #t "fold3-ec")
(generator #t "generator")
(if #t "if")
(not #t "not")
(and #t "and")
(or #t "or")
(begin #t "begin")
(nested #t "nested")
(: #t ":")
(:list #t ":list")
(:string #t ":string")
(:vector #t ":vector")
(:integers #t ":integers")
(:range #t ":range")
(:real-range #t ":real-range")
(:char-range #t ":char-range")
(:port #t ":port")
(:dispatched #t "")
(:generator-proc #t ":generator-proc")
(:do #t ":do")
(:let #t ":let")
(:parallel #t ":parallel")
(:while #t ":while")
(:until #t ":until")
)]
@; ----------------------------------------
@srfi[43]{Vector Library}
@redirect[43 '(
(make-vector #f "make-vector")
(vector #f "vector")
(vector-unfold #f "vector-unfold")
(vector-unfold-right #f "vector-unfold-right")
(vector-copy #f "vector-copy")
(vector-reverse-copy #f "vector-reverse-copy")
(vector-append #f "vector-append")
(vector-concatenate #f "vector-concatenate")
(vector? #f "vector-p")
(vector-empty? #f "vector-empty?")
(vector= #f "vector-eq")
(vector-ref #f "vector-ref")
(vector-length #f "vector-length")
(vector-fold #f "vector-fold")
(vector-fold-right #f "vector-fold-right")
(vector-map #f "vector-map")
(vector-map! #f "vector-map-bang")
(vector-for-each #f "vector-for-each")
(vector-count #f "vector-count")
(vector-index #f "vector-index")
(vector-index-right #f "vector-index-right")
(vector-skip #f "vector-skip")
(vector-skip-right #f "vector-skip-right")
(vector-binary-search #f "vector-binary-search")
(vector-any #f "vector-any")
(vector-every #f "vector-every")
(vector-set! #f "vector-set-bang")
(vector-swap! #f "vector-swap-bang")
(vector-fill! #f "vector-fill-bang")
(vector-reverse! #f "vector-reverse-bang")
(vector-copy! #f "vector-copy-bang")
(vector-reverse-copy! #f "vector-reverse-copy-bang")
(vector->list #f "vector->list")
(reverse-vector->list #f "reverse-vector->list")
(list->vector #f "list->vector")
(reverse-list->vector #f "reverse-list->vector")
)]
@; ----------------------------------------
@srfi[45]{Primitives for Expressing Iterative Lazy Algorithms}
@redirect[45 '(
(delay #t "delay")
(lazy #t "lazy")
(force #f "force")
(eager #f "eager")
)]
Additional binding:
@defproc[(promise? [v any/c]) boolean?]{
Returns @scheme[#t] if @scheme[v] is a promise, @scheme[#f] otherwise.}
@; ----------------------------------------
@srfi[48]{Intermediate Format Strings}
@redirect[48 '(
(format #f "format")
)]
@; ----------------------------------------
@srfi[54]{Formatting}
@; ----------------------------------------
@srfi[57]{Records}
@; ----------------------------------------
@srfi[59]{Vicinity}
@redirect[59 '(
(program-vicinity #f "program-vicinity")
(library-vicinity #f "library-vicinity")
(implementation-vicinity #f "implementation-vicinity")
(user-vicinity #f "user-vicinity")
(home-vicinity #f "home-vicinity")
(in-vicinity #f "in-vicinity")
(sub-vicinity #f "sub-vicinity")
(make-vicinity #f "make-vicinity")
(pathname->vicinity #f "pathname-to-vicinity")
(vicinity:suffix? #f "vicinity:suffix-p")
)]
@; ----------------------------------------
@srfi[60]{Integers as Bits}
@; ----------------------------------------
@srfi[61]{A more general cond clause}
@; ----------------------------------------
@srfi[62]{S-expression comments}
This SRFI's syntax is part of PLT Scheme's default reader.
@; ----------------------------------------
@srfi[63]{Homogeneous and Heterogeneous Arrays}
@; ----------------------------------------
@srfi[64]{A Scheme API for test suites}
@; ----------------------------------------
@srfi[66]{Octet Vectors}
@; ----------------------------------------
@srfi[67 #:subdir "srfi-67/"]{Compare Procedures}
@; ----------------------------------------
@srfi[69]{Basic hash tables}
@; ----------------------------------------
@srfi[71]{Extended LET-syntax for multiple values}
@; ----------------------------------------
@srfi[74]{Octet-Addressed Binary Blocks}
@; ----------------------------------------
@srfi[78]{Lightweight testing}
@; ----------------------------------------
@srfi[86]{MU & NU simulating VALUES & CALL-WITH-VALUES...}
@; ----------------------------------------
@srfi[87]{=> in case clauses}
@; ----------------------------------------
@index-section[]

343
doc/r5rs-std/index.html Normal file
View File

@ -0,0 +1,343 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="index,follow">
</head>
<body>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<div align=center>
<h1><br><br>Revised<sup>5</sup> Report on the Algorithmic Language Scheme</h1>
<p>
20 February 1998<br>
<br>
Richard Kelsey, William Clinger, and Jonathan Rees (<i>Editors</i>)<br>
&nbsp;<br>
<table width=100%>
<tr><td>H. Abelson </td><td> R. K. Dybvig </td><td> C. T. Haynes </td><td> G. J. Rozas</td></tr>
<tr><td>N. I. Adams IV </td><td> D. P. Friedman </td><td> E. Kohlbecker </td><td> G. L. Steele Jr.</td></tr>
<tr><td>D. H. Bartley </td><td> R. Halstead </td><td> D. Oxley </td><td> G. J. Sussman</td></tr>
<tr><td>G. Brooks </td><td> C. Hanson </td><td> K. M. Pitman </td><td> M. Wand</td></tr>
</table><br>
<em>Dedicated to the Memory of Robert Hieb</em>
</p>
<p></div>
</p>
<p></p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<div class=navigation>[Go to <span class=disable>first, previous</span><span><span class=disable>, </span><a href="r5rs-Z-H-1.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
</body>
</html>

102
doc/r5rs-std/r5rs-Z-C.css Normal file
View File

@ -0,0 +1,102 @@
body {
color: black;
/*background-color: #e5e5e5; */
/*background-color: beige;*/
margin-top: 2em;
margin-left: 8%;
margin-right: 8%;
}
h1,h2,h3,h4,h5,h6 {
margin-top: .5em;
}
.partheading {
font-size: 90%;
}
.chapterheading {
font-size: 90%;
}
pre {
margin-left: 2em;
}
ol {
list-style-type: decimal;
}
ol ol {
list-style-type: lower-alpha;
}
ol ol ol {
list-style-type: lower-roman;
}
ol ol ol ol {
list-style-type: upper-alpha;
}
.scheme {
color: brown;
}
.scheme .keyword {
color: #990000;
font-weight: bold;
}
.scheme .builtin {
color: #990000;
}
.scheme .variable {
color: navy;
}
.scheme .global {
color: purple;
}
.scheme .selfeval {
color: green;
}
.scheme .comment {
color: teal;
}
.schemeresponse {
color: green;
}
.navigation {
color: red;
text-align: right;
font-style: italic;
}
.disable {
/* color: #e5e5e5; */
color: gray;
}
.smallcaps {
font-size: 75%;
}
.smallprint {
color: gray;
font-size: 75%;
text-align: right;
}
.smallprint hr {
text-align: left;
width: 40%;
}

BIN
doc/r5rs-std/r5rs-Z-G-1.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
doc/r5rs-std/r5rs-Z-G-2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 936 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

BIN
doc/r5rs-std/r5rs-Z-G-3.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

BIN
doc/r5rs-std/r5rs-Z-G-4.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
doc/r5rs-std/r5rs-Z-G-5.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
doc/r5rs-std/r5rs-Z-G-6.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 960 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

BIN
doc/r5rs-std/r5rs-Z-G-7.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
doc/r5rs-std/r5rs-Z-G-8.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

BIN
doc/r5rs-std/r5rs-Z-G-9.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 B

View File

@ -0,0 +1,59 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="noindex,follow">
</head>
<body>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs.html">previous</a></span><span>, <a href="r5rs-Z-H-2.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
<a name="%_chap_Temp_1"></a>
<h1 class=chapter>
<div class=chapterheading>&nbsp;</div><br>
<a href="r5rs-Z-H-2.html#%_toc_%_chap_Temp_1">Summary</a></h1>
<p>The report gives a defining description of the programming language
Scheme. Scheme is a statically scoped and properly tail-recursive
dialect of the Lisp programming language invented by Guy Lewis
Steele&nbsp;Jr. and Gerald Jay&nbsp;Sussman. It was designed to have an
exceptionally clear and simple semantics and few different ways to
form expressions. A wide variety of programming paradigms, including
imperative, functional, and message passing styles, find convenient
expression in Scheme.</p>
<p>
The introduction offers a brief history of the language and of
the report.</p>
<p>
The first three chapters present the fundamental ideas of the
language and describe the notational conventions used for describing the
language and for writing programs in the language.</p>
<p>
Chapters&nbsp;<a href="r5rs-Z-H-7.html#%_chap_4">4</a> and&nbsp;<a href="r5rs-Z-H-8.html#%_chap_5">5</a> describe
the syntax and semantics of expressions, programs, and definitions.</p>
<p>
Chapter&nbsp;<a href="r5rs-Z-H-9.html#%_chap_6">6</a> describes Scheme's built-in
procedures, which include all of the language's data manipulation and
input/output primitives.</p>
<p>
Chapter&nbsp;<a href="r5rs-Z-H-10.html#%_chap_7">7</a> provides a formal syntax for Scheme
written in extended BNF, along with a formal denotational semantics.
An example of the use of the language follows the formal syntax and
semantics.</p>
<p>
The report concludes with a list of references and an
alphabetic index.</p>
<p>
</p>
<p>
</p>
<p>
</p>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs.html">previous</a></span><span>, <a href="r5rs-Z-H-2.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
</body>
</html>

View File

@ -0,0 +1,681 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="noindex,follow">
</head>
<body>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-9.html">previous</a></span><span>, <a href="r5rs-Z-H-11.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
<a name="%_chap_7"></a>
<h1 class=chapter>
<div class=chapterheading><a href="r5rs-Z-H-2.html#%_toc_%_chap_7">Chapter 7</a></div><br>
<a href="r5rs-Z-H-2.html#%_toc_%_chap_7">Formal syntax and semantics</a></h1>
<p></p>
<p>
This chapter provides formal descriptions of what has already been
described informally in previous chapters of this report.</p>
<p>
</p>
<p>
</p>
<a name="%_sec_7.1"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_7.1">7.1&nbsp;&nbsp;Formal syntax</a></h2>
<p></p>
<p>
This section provides a formal syntax for Scheme written in an extended
BNF.</p>
<p>
All spaces in the grammar are for legibility. Case is insignificant;
for example, <tt>#x1A</tt> and <tt>#X1a</tt> are equivalent. &lt;empty&gt;
stands for the empty string.</p>
<p>
The following extensions to BNF are used to make the description more
concise: &lt;thing&gt;* means zero or more occurrences of
&lt;thing&gt;; and &lt;thing&gt;<sup>+</sup> means at least one
&lt;thing&gt;.</p>
<p>
</p>
<a name="%_sec_7.1.1"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_7.1.1">7.1.1&nbsp;&nbsp;Lexical structure</a></h3>
<p>This section describes how individual tokens<a name="%_idx_674"></a> (identifiers,
numbers, etc.) are formed from sequences of characters. The following
sections describe how expressions and programs are formed from sequences
of tokens.</p>
<p>
&lt;Intertoken space&gt; may occur on either side of any token, but not
within a token.</p>
<p>
Tokens which require implicit termination (identifiers, numbers,
characters, and dot) may be terminated by any &lt;delimiter&gt;, but not
necessarily by anything else.</p>
<p>
The following five characters are reserved for future extensions to the
language: <tt><code class=verbatim>[</code> <code class=verbatim>]</code> <code class=verbatim>{</code> <code class=verbatim>}</code> <code class=verbatim>|</code></tt></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-2.gif" border="0"></div>
<p></p>
<p>
</p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-3.gif" border="0"></div>
<p></p>
<p>
</p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-4.gif" border="0"></div>
<p></p>
<p>
The following rules for &lt;num <em>R</em>&gt;, &lt;complex <em>R</em>&gt;, &lt;real
<em>R</em>&gt;, &lt;ureal <em>R</em>&gt;, &lt;uinteger <em>R</em>&gt;, and &lt;prefix <em>R</em>&gt;
should be replicated for <em>R</em> = 2, 8, 10,
and 16. There are no rules for &lt;decimal 2&gt;, &lt;decimal
8&gt;, and &lt;decimal 16&gt;, which means that numbers containing
decimal points or exponents must be in decimal radix.
</p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-5.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-6.gif" border="0"></div>
<p></p>
<p>
</p>
<p>
</p>
<a name="%_sec_7.1.2"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_7.1.2">7.1.2&nbsp;&nbsp;External representations</a></h3>
<p></p>
<p>
&lt;Datum&gt; is what the <tt>read</tt> procedure (section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.6.2">6.6.2</a>)
successfully parses. Note that any string that parses as an
&lt;expression&gt; will also parse as a &lt;datum&gt;. </p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-7.gif" border="0"></div>
<p></p>
<p>
</p>
<a name="%_sec_7.1.3"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_7.1.3">7.1.3&nbsp;&nbsp;Expressions</a></h3>
<p></p>
<div align=left><img src="r5rs-Z-G-8.gif" border="0"></div>
<p></p>
<p>
</p>
<a name="%_sec_7.1.4"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_7.1.4">7.1.4&nbsp;&nbsp;Quasiquotations</a></h3>
<p>The following grammar for quasiquote expressions is not context-free.
It is presented as a recipe for generating an infinite number of
production rules. Imagine a copy of the following rules for <em>D</em> = 1, 2,
3, <tt>...</tt>. <em>D</em> keeps track of the nesting depth.</p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-9.gif" border="0"></div>
<p></p>
<p>
In &lt;quasiquotation&gt;s, a &lt;list qq template <em>D</em>&gt; can sometimes
be confused with either an &lt;unquotation <em>D</em>&gt; or a &lt;splicing
unquotation <em>D</em>&gt;. The interpretation as an
&lt;unquotation&gt; or &lt;splicing
unquotation <em>D</em>&gt; takes precedence.</p>
<p>
</p>
<a name="%_sec_7.1.5"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_7.1.5">7.1.5&nbsp;&nbsp;Transformers</a></h3>
<p></p>
<div align=left><img src="r5rs-Z-G-10.gif" border="0"></div>
<p></p>
<p>
</p>
<a name="%_sec_7.1.6"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_7.1.6">7.1.6&nbsp;&nbsp;Programs and definitions</a></h3>
<p></p>
<div align=left><img src="r5rs-Z-G-11.gif" border="0"></div>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p></p>
<a name="%_sec_7.2"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_7.2">7.2&nbsp;&nbsp;Formal semantics</a></h2>
<p></p>
<p>
</p>
<p>
</p>
<p>
This section provides a formal denotational semantics for the primitive
expressions of Scheme and selected built-in procedures. The concepts
and notation used here are described in&nbsp;[<a href="r5rs-Z-H-14.html#cite{Stoy77}">29</a>]; the notation is
summarized below:</p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-12.gif" border="0"></div>
<p></p>
<p>
The reason that expression continuations take sequences of values instead
of single values is to simplify the formal treatment of procedure calls
and multiple return values.</p>
<p>
The boolean flag associated with pairs, vectors, and strings will be true
for mutable objects and false for immutable objects.</p>
<p>
The order of evaluation within a call is unspecified. We mimic that
here by applying arbitrary permutations <i>permute</i> and <i>unpermute</i>, which must be inverses, to the arguments in a call before
and after they are evaluated. This is not quite right since it suggests,
incorrectly, that the order of evaluation is constant throughout a program (for
any given number of arguments), but it is a closer approximation to the intended
semantics than a left-to-right evaluation would be.</p>
<p>
The storage allocator <i>new</i> is implementation-dependent, but it must
obey the following axiom: if <i>new</i> <img src="r5rs-Z-G-D-2.gif" border="0"> <img src="r5rs-Z-G-D-4.gif" border="0"> <tt><em>L</em></tt>, then
<img src="r5rs-Z-G-D-2.gif" border="0"> (<i>new</i> <img src="r5rs-Z-G-D-2.gif" border="0"> | <tt><em>L</em></tt>)<img src="r5rs-Z-G-D-7.gif" border="0"> 2 = <i><em>f</em><em>a</em><em>l</em><em>s</em><em>e</em></i>.</p>
<p>
</p>
<p>
The definition of <img src="r5rs-Z-G-D-5.gif" border="0"> is omitted because an accurate definition of
<img src="r5rs-Z-G-D-5.gif" border="0"> would complicate the semantics without being very interesting.</p>
<p>
If P is a program in which all variables are defined before being
referenced or assigned, then the meaning of P is
</p>
<div align=left><img src="r5rs-Z-G-13.gif" border="0"></div>
<p>
where I* is the sequence of variables defined in P, P'
is the sequence of expressions obtained by replacing every definition
in P by an assignment, &lt;undefined&gt; is an expression that evaluates
to <i>undefined</i>, and
<img src="r5rs-Z-G-D-6.gif" border="0"> is the semantic function that assigns meaning to expressions.</p>
<p>
</p>
<p>
</p>
<a name="%_sec_7.2.1"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_7.2.1">7.2.1&nbsp;&nbsp;Abstract syntax</a></h3>
<p>
</p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-14.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-15.gif" border="0"></div>
<p></p>
<p>
</p>
<a name="%_sec_7.2.2"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_7.2.2">7.2.2&nbsp;&nbsp;Domain equations</a></h3>
<p></p>
<div align=left><img src="r5rs-Z-G-16.gif" border="0"></div>
<p></p>
<p>
</p>
<a name="%_sec_7.2.3"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_7.2.3">7.2.3&nbsp;&nbsp;Semantic functions</a></h3>
<p>
</p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-17.gif" border="0"></div>
<p></p>
<p>
</p>
<p>
</p>
<p>
</p>
<p></p>
<p></p>
<p>
Definition of <img src="r5rs-Z-G-D-5.gif" border="0"> deliberately omitted.</p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-18.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-19.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-20.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-21.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-22.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-23.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-24.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-25.gif" border="0"></div>
<p></p>
<p>
Here and elsewhere, any expressed value other than <i>undefined</i> may
be used in place of <i>unspecified</i>.</p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-26.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-27.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-28.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-29.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-30.gif" border="0"></div>
<p></p>
<p>
</p>
<a name="%_sec_7.2.4"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_7.2.4">7.2.4&nbsp;&nbsp;Auxiliary functions</a></h3>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-31.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-32.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-33.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-34.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-35.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-36.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-37.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-38.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-39.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-40.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-41.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-42.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-43.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-44.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-45.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-46.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-47.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-48.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-49.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-50.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-51.gif" border="0"></div>
<p></p>
<p>
<a name="%_idx_676"></a>
</p>
<div align=left><img src="r5rs-Z-G-52.gif" border="0"></div>
<p></p>
<p>
<a name="%_idx_678"></a>
</p>
<div align=left><img src="r5rs-Z-G-53.gif" border="0"></div>
<p></p>
<p>
<a name="%_idx_680"></a>
</p>
<div align=left><img src="r5rs-Z-G-54.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-55.gif" border="0"></div>
<p></p>
<p>
<a name="%_idx_682"></a>
</p>
<div align=left><img src="r5rs-Z-G-56.gif" border="0"></div>
<p></p>
<p>
<a name="%_idx_684"></a>
</p>
<div align=left><img src="r5rs-Z-G-57.gif" border="0"></div>
<p></p>
<p>
<a name="%_idx_686"></a>
</p>
<div align=left><img src="r5rs-Z-G-58.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-59.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-60.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-61.gif" border="0"></div>
<p></p>
<p>
</p>
<div align=left><img src="r5rs-Z-G-62.gif" border="0"></div>
<p></p>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p></p>
<a name="%_sec_7.3"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_7.3">7.3&nbsp;&nbsp;Derived expression types</a></h2>
<p></p>
<p>
This section gives macro definitions for the derived expression types in
terms of the primitive expression types (literal, variable, call, <tt>lambda</tt>,
<tt>if</tt>, <tt>set!</tt>). See section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.4">6.4</a> for a possible
definition of <tt>delay</tt>.</p>
<p>
<tt>(define-syntax&nbsp;<tt>cond</tt><br>
&nbsp;&nbsp;(syntax-rules&nbsp;(else&nbsp;=&gt;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;((cond&nbsp;(else&nbsp;result1&nbsp;result2&nbsp;...))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(begin&nbsp;result1&nbsp;result2&nbsp;...))<br>
&nbsp;&nbsp;&nbsp;&nbsp;((cond&nbsp;(test&nbsp;=&gt;&nbsp;result))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;((temp&nbsp;test))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;temp&nbsp;(result&nbsp;temp))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;((cond&nbsp;(test&nbsp;=&gt;&nbsp;result)&nbsp;clause1&nbsp;clause2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;((temp&nbsp;test))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;temp<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(result&nbsp;temp)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cond&nbsp;clause1&nbsp;clause2&nbsp;...))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;((cond&nbsp;(test))&nbsp;test)<br>
&nbsp;&nbsp;&nbsp;&nbsp;((cond&nbsp;(test)&nbsp;clause1&nbsp;clause2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;((temp&nbsp;test))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;temp<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;temp<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cond&nbsp;clause1&nbsp;clause2&nbsp;...))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;((cond&nbsp;(test&nbsp;result1&nbsp;result2&nbsp;...))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;test&nbsp;(begin&nbsp;result1&nbsp;result2&nbsp;...)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;((cond&nbsp;(test&nbsp;result1&nbsp;result2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clause1&nbsp;clause2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;test<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(begin&nbsp;result1&nbsp;result2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cond&nbsp;clause1&nbsp;clause2&nbsp;...)))))<br>
</p>
</tt>
<p>
<tt>(define-syntax&nbsp;<tt>case</tt><br>
&nbsp;&nbsp;(syntax-rules&nbsp;(else)<br>
&nbsp;&nbsp;&nbsp;&nbsp;((case&nbsp;(key&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clauses&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;((atom-key&nbsp;(key&nbsp;...)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(case&nbsp;atom-key&nbsp;clauses&nbsp;...)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;((case&nbsp;key<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(else&nbsp;result1&nbsp;result2&nbsp;...))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(begin&nbsp;result1&nbsp;result2&nbsp;...))<br>
&nbsp;&nbsp;&nbsp;&nbsp;((case&nbsp;key<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((atoms&nbsp;...)&nbsp;result1&nbsp;result2&nbsp;...))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(memv&nbsp;key&nbsp;'(atoms&nbsp;...))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(begin&nbsp;result1&nbsp;result2&nbsp;...)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;((case&nbsp;key<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((atoms&nbsp;...)&nbsp;result1&nbsp;result2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clause&nbsp;clauses&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(memv&nbsp;key&nbsp;'(atoms&nbsp;...))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(begin&nbsp;result1&nbsp;result2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(case&nbsp;key&nbsp;clause&nbsp;clauses&nbsp;...)))))<br>
</p>
</tt>
<p>
<tt>(define-syntax&nbsp;<tt>and</tt><br>
&nbsp;&nbsp;(syntax-rules&nbsp;()<br>
&nbsp;&nbsp;&nbsp;&nbsp;((and)&nbsp;<tt>#t</tt>)<br>
&nbsp;&nbsp;&nbsp;&nbsp;((and&nbsp;test)&nbsp;test)<br>
&nbsp;&nbsp;&nbsp;&nbsp;((and&nbsp;test1&nbsp;test2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;test1&nbsp;(and&nbsp;test2&nbsp;...)&nbsp;<tt>#f</tt>))))<br>
</p>
</tt>
<p>
<tt>(define-syntax&nbsp;<tt>or</tt><br>
&nbsp;&nbsp;(syntax-rules&nbsp;()<br>
&nbsp;&nbsp;&nbsp;&nbsp;((or)&nbsp;<tt>#f</tt>)<br>
&nbsp;&nbsp;&nbsp;&nbsp;((or&nbsp;test)&nbsp;test)<br>
&nbsp;&nbsp;&nbsp;&nbsp;((or&nbsp;test1&nbsp;test2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;((x&nbsp;test1))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;x&nbsp;x&nbsp;(or&nbsp;test2&nbsp;...))))))<br>
</p>
</tt>
<p>
<tt>(define-syntax&nbsp;<tt>let</tt><br>
&nbsp;&nbsp;(syntax-rules&nbsp;()<br>
&nbsp;&nbsp;&nbsp;&nbsp;((let&nbsp;((name&nbsp;val)&nbsp;...)&nbsp;body1&nbsp;body2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((lambda&nbsp;(name&nbsp;...)&nbsp;body1&nbsp;body2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;val&nbsp;...))<br>
&nbsp;&nbsp;&nbsp;&nbsp;((let&nbsp;tag&nbsp;((name&nbsp;val)&nbsp;...)&nbsp;body1&nbsp;body2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((letrec&nbsp;((tag&nbsp;(lambda&nbsp;(name&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;body1&nbsp;body2&nbsp;...)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tag)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;val&nbsp;...))))<br>
</p>
</tt>
<p>
<tt>(define-syntax&nbsp;<tt>let*</tt><br>
&nbsp;&nbsp;(syntax-rules&nbsp;()<br>
&nbsp;&nbsp;&nbsp;&nbsp;((let*&nbsp;()&nbsp;body1&nbsp;body2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;()&nbsp;body1&nbsp;body2&nbsp;...))<br>
&nbsp;&nbsp;&nbsp;&nbsp;((let*&nbsp;((name1&nbsp;val1)&nbsp;(name2&nbsp;val2)&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;body1&nbsp;body2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;((name1&nbsp;val1))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let*&nbsp;((name2&nbsp;val2)&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;body1&nbsp;body2&nbsp;...)))))<br>
</p>
</tt>
<p>
The following <tt>letrec</tt> macro uses the symbol <tt>&lt;undefined&gt;</tt>
in place of an expression which returns something that when stored in
a location makes it an error to try to obtain the value stored in the
location (no such expression is defined in Scheme).
A trick is used to generate the temporary names needed to avoid
specifying the order in which the values are evaluated.
This could also be accomplished by using an auxiliary macro.</p>
<p>
<tt>(define-syntax&nbsp;<tt>letrec</tt><br>
&nbsp;&nbsp;(syntax-rules&nbsp;()<br>
&nbsp;&nbsp;&nbsp;&nbsp;((letrec&nbsp;((var1&nbsp;init1)&nbsp;...)&nbsp;body&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(letrec&nbsp;&quot;generate_temp_names&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(var1&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((var1&nbsp;init1)&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;body&nbsp;...))<br>
&nbsp;&nbsp;&nbsp;&nbsp;((letrec&nbsp;&quot;generate_temp_names&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(temp1&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((var1&nbsp;init1)&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;body&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;((var1&nbsp;&lt;undefined&gt;)&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;((temp1&nbsp;init1)&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(set!&nbsp;var1&nbsp;temp1)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;body&nbsp;...)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;((letrec&nbsp;&quot;generate_temp_names&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(x&nbsp;y&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(temp&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((var1&nbsp;init1)&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;body&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(letrec&nbsp;&quot;generate_temp_names&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(y&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(newtemp&nbsp;temp&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((var1&nbsp;init1)&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;body&nbsp;...))))<br>
</p>
</tt>
<p>
<tt>(define-syntax&nbsp;<tt>begin</tt><br>
&nbsp;&nbsp;(syntax-rules&nbsp;()<br>
&nbsp;&nbsp;&nbsp;&nbsp;((begin&nbsp;exp&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((lambda&nbsp;()&nbsp;exp&nbsp;...)))))<br>
</p>
</tt>
<p>
The following alternative expansion for <tt>begin</tt> does not make use of
the ability to write more than one expression in the body of a lambda
expression. In any case, note that these rules apply only if the body
of the <tt>begin</tt> contains no definitions.</p>
<p>
<tt>(define-syntax&nbsp;begin<br>
&nbsp;&nbsp;(syntax-rules&nbsp;()<br>
&nbsp;&nbsp;&nbsp;&nbsp;((begin&nbsp;exp)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exp)<br>
&nbsp;&nbsp;&nbsp;&nbsp;((begin&nbsp;exp1&nbsp;exp2&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;((x&nbsp;exp1))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(begin&nbsp;exp2&nbsp;...)))))<br>
</p>
</tt>
<p>
The following definition
of <tt>do</tt> uses a trick to expand the variable clauses.
As with <tt>letrec</tt> above, an auxiliary macro would also work.
The expression <tt>(if #f #f)</tt> is used to obtain an unspecific
value.</p>
<p>
<tt>(define-syntax&nbsp;<tt>do</tt><br>
&nbsp;&nbsp;(syntax-rules&nbsp;()<br>
&nbsp;&nbsp;&nbsp;&nbsp;((do&nbsp;((var&nbsp;init&nbsp;step&nbsp;...)&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(test&nbsp;expr&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(letrec<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((loop<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(lambda&nbsp;(var&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;test<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(begin<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;#f&nbsp;#f)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;expr&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(begin<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(loop&nbsp;(do&nbsp;&quot;step&quot;&nbsp;var&nbsp;step&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...))))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(loop&nbsp;init&nbsp;...)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;((do&nbsp;&quot;step&quot;&nbsp;x)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x)<br>
&nbsp;&nbsp;&nbsp;&nbsp;((do&nbsp;&quot;step&quot;&nbsp;x&nbsp;y)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y)))<br>
</p>
</tt>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>
</p>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-9.html">previous</a></span><span>, <a href="r5rs-Z-H-11.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
</body>
</html>

View File

@ -0,0 +1,112 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="noindex,follow">
</head>
<body>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-10.html">previous</a></span><span>, <a href="r5rs-Z-H-12.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
<a name="%_chap_Temp_6"></a>
<h1 class=chapter>
<div class=chapterheading>&nbsp;</div><br>
<a href="r5rs-Z-H-2.html#%_toc_%_chap_Temp_6">Notes</a></h1>
<p>
</p>
<p></p>
<p></p>
<p>
</p>
<p>
</p>
<a name="%_sec_Temp_7"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_Temp_7">Language changes</a></h3>
<p></p>
<p>
This section enumerates the changes that have been made to Scheme since
the ``Revised<sup>4</sup> report''&nbsp;[<a href="r5rs-Z-H-14.html#cite{R4RS}">6</a>] was published.</p>
<p>
</p>
<ul>
<p>
</p>
<li>
<p>The report is now a superset of the IEEE standard for Scheme
[<a href="r5rs-Z-H-14.html#cite{IEEEScheme}">13</a>]: implementations that conform to the report will
also conform to the standard. This required the following changes:
</p>
<ul>
<p>
</p>
<li>
<p>The empty list is now required to count as true.</p>
<p>
</p>
<li>
<p>The classification of features as essential or inessential has been
removed. There are now three classes of built-in procedures: primitive,
library, and optional. The optional procedures are <tt>load</tt>,
<tt>with-input-from-file</tt>, <tt>with-output-to-file</tt>,
<tt>transcript-on</tt>, <tt>transcript-off</tt>, and
<tt>interaction-environment</tt>,
and <tt>-</tt> and <tt>/</tt> with more than two arguments.
None of these are in the IEEE standard.</p>
<p>
</p>
<li>
<p>Programs are allowed to redefine built-in procedures. Doing so
will not change the behavior of other built-in procedures.
</p>
</ul>
<p></p>
<p>
</p>
<li>
<p><em>Port</em> has been added to the list of disjoint types.</p>
<p>
</p>
<li>
<p>The macro appendix has been removed. High-level macros are now part
of the main body of the report. The rewrite rules for derived expressions
have been replaced with macro definitions. There are no reserved identifiers.</p>
<p>
</p>
<li>
<p><tt>Syntax-rules</tt> now allows vector patterns.</p>
<p>
</p>
<li>
<p>Multiple-value returns, <tt>eval</tt>, and <tt>dynamic-wind</tt> have
been added.</p>
<p>
</p>
<li>
<p>The calls that are required to be implemented in a properly tail-recursive
fashion are defined explicitly.</p>
<p>
</p>
<li>
<p>`<tt>@</tt>' can be used within identifiers. `<tt><code class=verbatim>|</code></tt>' is reserved
for possible future extensions.</p>
<p>
</p>
</ul>
<p></p>
<p>
</p>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>
</p>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-10.html">previous</a></span><span>, <a href="r5rs-Z-H-12.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
</body>
</html>

View File

@ -0,0 +1,40 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="noindex,follow">
</head>
<body>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-11.html">previous</a></span><span>, <a href="r5rs-Z-H-13.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
<a name="%_chap_Temp_8"></a>
<h1 class=chapter>
<div class=chapterheading>&nbsp;</div><br>
<a href="r5rs-Z-H-2.html#%_toc_%_chap_Temp_8">Additional material</a></h1>
<p>
</p>
<p></p>
<p></p>
<p>
The Internet Scheme Repository at
</p>
<div align=center><table><tr><td>
<tt>http://www.cs.indiana.edu/scheme-repository/</tt>
</td></tr></table></div>
contains an extensive Scheme bibliography, as well as papers,
programs, implementations, and other material related to Scheme.
<p>
</p>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-11.html">previous</a></span><span>, <a href="r5rs-Z-H-13.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
</body>
</html>

View File

@ -0,0 +1,160 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="noindex,follow">
</head>
<body>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-12.html">previous</a></span><span>, <a href="r5rs-Z-H-14.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
<a name="%_chap_Temp_9"></a>
<h1 class=chapter>
<div class=chapterheading>&nbsp;</div><br>
<a href="r5rs-Z-H-2.html#%_toc_%_chap_Temp_9">Example</a></h1>
<p>
</p>
<p></p>
<p>
<tt>Integrate-system</tt> integrates the system
</p>
<div align=left><img src="r5rs-Z-G-63.gif" border="0"></div>
<p>
of differential equations with the method of Runge-Kutta.</p>
<p>
The parameter <tt>system-derivative</tt> is a function that takes a system
state (a vector of values for the state variables <em>y</em><sub>1</sub>, <tt>...</tt>, <em>y</em><sub><em>n</em></sub>)
and produces a system derivative (the values <em>y</em><sub>1</sub><sup>/</sup>, <tt>...</tt>,
<em>y</em><sub><em>n</em></sub><sup>/</sup>). The parameter <tt>initial-state</tt> provides an initial
system state, and <tt>h</tt> is an initial guess for the length of the
integration step.</p>
<p>
The value returned by <tt>integrate-system</tt> is an infinite stream of
system states.</p>
<p>
<tt>(define&nbsp;integrate-system<br>
&nbsp;&nbsp;(lambda&nbsp;(system-derivative&nbsp;initial-state&nbsp;h)<br>
&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;((next&nbsp;(runge-kutta-4&nbsp;system-derivative&nbsp;h)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(letrec&nbsp;((states<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cons&nbsp;initial-state<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(delay&nbsp;(map-streams&nbsp;next<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;states)))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;states))))</p>
</tt>
<p>
<tt>Runge-Kutta-4</tt> takes a function, <tt>f</tt>, that produces a
system derivative from a system state. <tt>Runge-Kutta-4</tt>
produces a function that takes a system state and
produces a new system state.</p>
<p>
<tt>(define&nbsp;runge-kutta-4<br>
&nbsp;&nbsp;(lambda&nbsp;(f&nbsp;h)<br>
&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;((*h&nbsp;(scale-vector&nbsp;h))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(*2&nbsp;(scale-vector&nbsp;2))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(*1/2&nbsp;(scale-vector&nbsp;(/&nbsp;1&nbsp;2)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(*1/6&nbsp;(scale-vector&nbsp;(/&nbsp;1&nbsp;6))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(lambda&nbsp;(y)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;y&nbsp;is&nbsp;a&nbsp;system&nbsp;state<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let*&nbsp;((k0&nbsp;(*h&nbsp;(f&nbsp;y)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(k1&nbsp;(*h&nbsp;(f&nbsp;(add-vectors&nbsp;y&nbsp;(*1/2&nbsp;k0)))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(k2&nbsp;(*h&nbsp;(f&nbsp;(add-vectors&nbsp;y&nbsp;(*1/2&nbsp;k1)))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(k3&nbsp;(*h&nbsp;(f&nbsp;(add-vectors&nbsp;y&nbsp;k2)))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(add-vectors&nbsp;y<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(*1/6&nbsp;(add-vectors&nbsp;k0<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(*2&nbsp;k1)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(*2&nbsp;k2)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k3))))))))<br>
<br>
(define&nbsp;elementwise<br>
&nbsp;&nbsp;(lambda&nbsp;(f)<br>
&nbsp;&nbsp;&nbsp;&nbsp;(lambda&nbsp;vectors<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate-vector<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(vector-length&nbsp;(car&nbsp;vectors))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(lambda&nbsp;(i)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(apply&nbsp;f<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map&nbsp;(lambda&nbsp;(v)&nbsp;(vector-ref&nbsp;&nbsp;v&nbsp;i))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vectors)))))))<br>
<br>
(define&nbsp;generate-vector<br>
&nbsp;&nbsp;(lambda&nbsp;(size&nbsp;proc)<br>
&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;((ans&nbsp;(make-vector&nbsp;size)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(letrec&nbsp;((loop<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(lambda&nbsp;(i)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cond&nbsp;((=&nbsp;i&nbsp;size)&nbsp;ans)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(else<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(vector-set!&nbsp;ans&nbsp;i&nbsp;(proc&nbsp;i))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(loop&nbsp;(+&nbsp;i&nbsp;1)))))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(loop&nbsp;0)))))<br>
<br>
(define&nbsp;add-vectors&nbsp;(elementwise&nbsp;+))<br>
<br>
(define&nbsp;scale-vector<br>
&nbsp;&nbsp;(lambda&nbsp;(s)<br>
&nbsp;&nbsp;&nbsp;&nbsp;(elementwise&nbsp;(lambda&nbsp;(x)&nbsp;(*&nbsp;x&nbsp;s)))))</p>
</tt>
<p>
<tt>Map-streams</tt> is analogous to <tt>map</tt>: it applies its first
argument (a procedure) to all the elements of its second argument (a
stream).</p>
<p>
<tt>(define&nbsp;map-streams<br>
&nbsp;&nbsp;(lambda&nbsp;(f&nbsp;s)<br>
&nbsp;&nbsp;&nbsp;&nbsp;(cons&nbsp;(f&nbsp;(head&nbsp;s))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(delay&nbsp;(map-streams&nbsp;f&nbsp;(tail&nbsp;s))))))</p>
</tt>
<p>
Infinite streams are implemented as pairs whose car holds the first
element of the stream and whose cdr holds a promise to deliver the rest
of the stream.</p>
<p>
<tt>(define&nbsp;head&nbsp;car)<br>
(define&nbsp;tail<br>
&nbsp;&nbsp;(lambda&nbsp;(stream)&nbsp;(force&nbsp;(cdr&nbsp;stream))))</p>
</tt>
<p>
</p>
<p><br></p>
<p><br></p>
<p>The following illustrates the use of <tt>integrate-system</tt> in
integrating the system
</p>
<div align=left><img src="r5rs-Z-G-64.gif" border="0"></div>
<p></p>
<div align=left><img src="r5rs-Z-G-65.gif" border="0"></div>
<p>
which models a damped oscillator.</p>
<p>
<tt>(define&nbsp;damped-oscillator<br>
&nbsp;&nbsp;(lambda&nbsp;(R&nbsp;L&nbsp;C)<br>
&nbsp;&nbsp;&nbsp;&nbsp;(lambda&nbsp;(state)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;((Vc&nbsp;(vector-ref&nbsp;state&nbsp;0))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Il&nbsp;(vector-ref&nbsp;state&nbsp;1)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(vector&nbsp;(-&nbsp;0&nbsp;(+&nbsp;(/&nbsp;Vc&nbsp;(*&nbsp;R&nbsp;C))&nbsp;(/&nbsp;Il&nbsp;C)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(/&nbsp;Vc&nbsp;L))))))<br>
<br>
(define&nbsp;the-states<br>
&nbsp;&nbsp;(integrate-system<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(damped-oscillator&nbsp;10000&nbsp;1000&nbsp;.001)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'#(1&nbsp;0)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.01))</p>
</tt>
<p>
</p>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>
</p>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-12.html">previous</a></span><span>, <a href="r5rs-Z-H-14.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
</body>
</html>

View File

@ -0,0 +1,277 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="noindex,follow">
</head>
<body>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-13.html">previous</a></span><span>, <a href="r5rs-Z-H-15.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
<a name="%_chap_Temp_10"></a>
<h1 class=chapter>
<div class=chapterheading>&nbsp;</div><br>
<a href="r5rs-Z-H-2.html#%_toc_%_chap_Temp_10">Bibliography</a></h1>
<p></p>
<table>
<p>
</p>
<tr><td align=right valign=top><a name="cite{SICP}"></a>[1]&nbsp;&nbsp;</td><td>
<p>
Harold Abelson and Gerald Jay Sussman with Julie Sussman.
<i>Structure and Interpretation of Computer Programs, second edition.</i>
MIT Press, Cambridge, 1996.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Bawden88}"></a>[2]&nbsp;&nbsp;</td><td>
<p> Alan Bawden and Jonathan Rees.
Syntactic closures.
In <i>Proceedings of the 1988 ACM Symposium on Lisp and
Functional Programming</i>, pages 86-95.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{howtoprint}"></a>[3]&nbsp;&nbsp;</td><td>
<p>
Robert G. Burger&nbsp;and R. Kent Dybvig.
Printing floating-point numbers quickly and accurately.
In <i>Proceedings of the ACM SIGPLAN '96 Conference
on Programming Language Design and Implementation</i>, pages&nbsp;108-116.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{RRRS}"></a>[4]&nbsp;&nbsp;</td><td>
<p>
William Clinger, editor.
The revised revised report on Scheme, or an uncommon Lisp.
MIT Artificial Intelligence Memo 848, August 1985.
Also published as Computer Science Department Technical Report 174,
Indiana University, June 1985.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{howtoread}"></a>[5]&nbsp;&nbsp;</td><td>
<p> William Clinger.
How to read floating point numbers accurately.
In <i>Proceedings of the ACM SIGPLAN '90 Conference
on Programming Language Design and Implementation</i>, pages 92-101.
Proceedings published as <i>SIGPLAN Notices</i> 25(6), June 1990.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{R4RS}"></a>[6]&nbsp;&nbsp;</td><td>
<p>
William Clinger and Jonathan Rees, editors.
The revised<sup>4</sup> report on the algorithmic language Scheme.
In <i>ACM Lisp Pointers</i> 4(3), pages&nbsp;1-55, 1991.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{macrosthatwork}"></a>[7]&nbsp;&nbsp;</td><td>
<p> William Clinger and Jonathan Rees.
Macros that work.
In <i>Proceedings of the 1991 ACM Conference on Principles of
Programming Languages</i>, pages&nbsp;155-162.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{propertailrecursion}"></a>[8]&nbsp;&nbsp;</td><td>
<p> William Clinger.
Proper Tail Recursion and Space Efficiency.
To appear in <i>Proceedings of the 1998 ACM Conference on Programming
Language Design and Implementation</i>, June 1998.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{syntacticabstraction}"></a>[9]&nbsp;&nbsp;</td><td>
<p>
R.&nbsp;Kent Dybvig, Robert Hieb, and Carl Bruggeman.
Syntactic abstraction in Scheme.
<i>Lisp and Symbolic Computation</i> 5(4):295-326, 1993.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Scheme311}"></a>[10]&nbsp;&nbsp;</td><td>
<p>
Carol Fessenden, William Clinger, Daniel P.&nbsp;Friedman, and Christopher Haynes.
Scheme 311 version 4 reference manual.
Indiana University Computer Science Technical Report 137, February 1983.
Superseded by&nbsp;[<a href="#cite{Scheme84}">11</a>].</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Scheme84}"></a>[11]&nbsp;&nbsp;</td><td>
<p>
D.&nbsp;Friedman, C.&nbsp;Haynes, E.&nbsp;Kohlbecker, and M.&nbsp;Wand.
Scheme 84 interim reference manual.
Indiana University Computer Science Technical Report 153, January 1985.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{IEEE}"></a>[12]&nbsp;&nbsp;</td><td>
<p>
<i>IEEE Standard 754-1985. IEEE Standard for Binary Floating-Point
Arithmetic.</i> IEEE, New York, 1985.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{IEEEScheme}"></a>[13]&nbsp;&nbsp;</td><td>
<p>
<i>IEEE Standard 1178-1990. IEEE Standard for the Scheme
Programming Language.</i> IEEE, New York, 1991.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Kohlbecker86}"></a>[14]&nbsp;&nbsp;</td><td>
<p>
Eugene E. Kohlbecker&nbsp;Jr.
<i>Syntactic Extensions in the Programming Language Lisp.</i>
PhD thesis, Indiana University, August 1986.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{hygienic}"></a>[15]&nbsp;&nbsp;</td><td>
<p>
Eugene E.&nbsp;Kohlbecker&nbsp;Jr., Daniel P.&nbsp;Friedman, Matthias Felleisen, and Bruce Duba.
Hygienic macro expansion.
In <i>Proceedings of the 1986 ACM Conference on Lisp
and Functional Programming</i>, pages 151-161.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Landin65}"></a>[16]&nbsp;&nbsp;</td><td>
<p>
Peter Landin.
A correspondence between Algol 60 and Church's lambda notation: Part I.
<i>Communications of the ACM</i> 8(2):89-101, February 1965.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{MITScheme}"></a>[17]&nbsp;&nbsp;</td><td>
<p>
MIT Department of Electrical Engineering and Computer Science.
Scheme manual, seventh edition.
September 1984.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Naur63}"></a>[18]&nbsp;&nbsp;</td><td>
<p>
Peter Naur et al.
Revised report on the algorithmic language Algol 60.
<i>Communications of the ACM</i> 6(1):1-17, January 1963.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Penfield81}"></a>[19]&nbsp;&nbsp;</td><td>
<p>
Paul Penfield, Jr.
Principal values and branch cuts in complex APL.
In <i>APL '81 Conference Proceedings,</i> pages 248-256.
ACM SIGAPL, San Francisco, September 1981.
Proceedings published as <i>APL Quote Quad</i> 12(1), ACM, September 1981.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Pitman83}"></a>[20]&nbsp;&nbsp;</td><td>
<p>
Kent M.&nbsp;Pitman.
The revised MacLisp manual (Saturday evening edition).
MIT Laboratory for Computer Science Technical Report 295, May 1983.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Rees82}"></a>[21]&nbsp;&nbsp;</td><td>
<p>
Jonathan A.&nbsp;Rees and Norman I.&nbsp;Adams IV.
T: A dialect of Lisp or, lambda: The ultimate software tool.
In <i>Conference Record of the 1982 ACM Symposium on Lisp and
Functional Programming</i>, pages 114-122.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Rees84}"></a>[22]&nbsp;&nbsp;</td><td>
<p>
Jonathan A.&nbsp;Rees, Norman I.&nbsp;Adams IV, and James R.&nbsp;Meehan.
The T manual, fourth edition.
Yale University Computer Science Department, January 1984.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{R3RS}"></a>[23]&nbsp;&nbsp;</td><td>
<p>
Jonathan Rees and William Clinger, editors.
The revised<sup>3</sup> report on the algorithmic language Scheme.
In <i>ACM SIGPLAN Notices</i> 21(12), pages&nbsp;37-79, December 1986.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Reynolds72}"></a>[24]&nbsp;&nbsp;</td><td>
<p>
John Reynolds.
Definitional interpreters for higher order programming languages.
In <i>ACM Conference Proceedings</i>, pages 717-740.
ACM, &nbsp;1972.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Scheme78}"></a>[25]&nbsp;&nbsp;</td><td>
<p>
Guy Lewis Steele Jr.&nbsp;and Gerald Jay Sussman.
The revised report on Scheme, a dialect of Lisp.
MIT Artificial Intelligence Memo 452, January 1978.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Rabbit}"></a>[26]&nbsp;&nbsp;</td><td>
<p>
Guy Lewis Steele Jr.
Rabbit: a compiler for Scheme.
MIT Artificial Intelligence Laboratory Technical Report 474, May 1978.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{CLtL}"></a>[27]&nbsp;&nbsp;</td><td>
<p>
Guy Lewis Steele Jr.
<i>Common Lisp: The Language, second edition.</i>
Digital Press, Burlington MA, 1990.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Scheme75}"></a>[28]&nbsp;&nbsp;</td><td>
<p>
Gerald Jay Sussman and Guy Lewis Steele Jr.
Scheme: an interpreter for extended lambda calculus.
MIT Artificial Intelligence Memo 349, December 1975.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{Stoy77}"></a>[29]&nbsp;&nbsp;</td><td>
<p>
Joseph E.&nbsp;Stoy.
<i>Denotational Semantics: The Scott-Strachey Approach to
Programming Language Theory.</i>
MIT Press, Cambridge, 1977.</p>
<p>
</p>
</td></tr>
<tr><td align=right valign=top><a name="cite{TImanual85}"></a>[30]&nbsp;&nbsp;</td><td>
<p>
Texas Instruments, Inc.
TI Scheme Language Reference Manual.
Preliminary version 1.0, November 1985. </p>
<p>
</p>
</table>
<p></p>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-13.html">previous</a></span><span>, <a href="r5rs-Z-H-15.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
</body>
</html>

View File

@ -0,0 +1,458 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="noindex,follow">
</head>
<body>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-14.html">previous</a></span><span class=disable>, next</span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span class=disable><span>; &nbsp;&nbsp;</span>index</span>]</div>
<p></p>
<a name="%_chap_Temp_11"></a>
<h1 class=chapter>
<div class=chapterheading>&nbsp;</div><br>
<a href="r5rs-Z-H-2.html#%_toc_%_chap_Temp_11">Alphabetic Index of Definitions of Concepts,
Keywords, and Procedures</a></h1>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p></p>
<p>
</p>
<p>
</p>
<p>
<a name="%_index_start"></p>
<p>
<br>
<a href="r5rs-Z-H-7.html#%_idx_88"><tt>'</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_402">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_284"><tt>*</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_282"><tt>+</tt></a>, <a href="r5rs-Z-H-10.html#%_idx_678">[2]</a><br>
<a href="r5rs-Z-H-7.html#%_idx_160"><tt>,</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_404">[2]</a><br>
<a href="r5rs-Z-H-7.html#%_idx_162"><tt>,@</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_286"><tt>-</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_288">[2]</a>,
<a href="r5rs-Z-H-9.html#%_idx_290">[3]</a><br>
<a href="r5rs-Z-H-7.html#%_idx_190"><tt>...</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_292"><tt>/</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_294">[2]</a>,
<a href="r5rs-Z-H-9.html#%_idx_296">[3]</a><br>
<a href="r5rs-Z-H-5.html#%_idx_24"><tt>;</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_260"><tt>&lt;</tt></a>, <a href="r5rs-Z-H-10.html#%_idx_676">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_264"><tt>&lt;=</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_258"><tt>=</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_112"><tt>=&gt;</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_262"><tt>&gt;</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_266"><tt>&gt;=</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_164"><tt>`</tt></a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_298"><tt>abs</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_338"><tt>acos</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_120"><tt>and</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_358"><tt>angle</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_438"><tt>append</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_578"><tt>apply</tt></a>, <a href="r5rs-Z-H-10.html#%_idx_686">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_336"><tt>asin</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_456"><tt>assoc</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_452"><tt>assq</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_454"><tt>assv</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_340"><tt>atan</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_342">[2]</a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_232"><tt>#b</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_156">backquote</a><br>
<a href="r5rs-Z-H-7.html#%_idx_138"><tt>begin</tt></a><br>
<a href="r5rs-Z-H-6.html#%_idx_32">binding</a><br>
<a href="r5rs-Z-H-6.html#%_idx_34">binding construct</a><br>
<a href="r5rs-Z-H-6.html#%_idx_46"><tt>boolean?</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_388">[2]</a><br>
<a href="r5rs-Z-H-6.html#%_idx_40">bound</a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_420"><tt>caar</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_422"><tt>cadr</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_90">call</a><br>
<a href="r5rs-Z-H-7.html#%_idx_150">call by need</a><br>
<a href="r5rs-Z-H-9.html#%_idx_588"><tt>call-with-current-continuation</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_610"><tt>call-with-input-file</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_612"><tt>call-with-output-file</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_596"><tt>call-with-values</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_410"><tt>car</tt></a>, <a href="r5rs-Z-H-10.html#%_idx_680">[2]</a><br>
<a href="r5rs-Z-H-7.html#%_idx_116"><tt>case</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_424"><tt>cdddar</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_426"><tt>cddddr</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_414"><tt>cdr</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_316"><tt>ceiling</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_498"><tt>char-&gt;integer</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_488"><tt>char-alphabetic?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_484"><tt>char-ci&lt;=?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_480"><tt>char-ci&lt;?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_478"><tt>char-ci=?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_486"><tt>char-ci&gt;=?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_482"><tt>char-ci&gt;?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_504"><tt>char-downcase</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_496"><tt>char-lower-case?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_490"><tt>char-numeric?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_648"><tt>char-ready?</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_650">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_502"><tt>char-upcase</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_494"><tt>char-upper-case?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_492"><tt>char-whitespace?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_474"><tt>char&lt;=?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_470"><tt>char&lt;?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_468"><tt>char=?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_476"><tt>char&gt;=?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_472"><tt>char&gt;?</tt></a><br>
<a href="r5rs-Z-H-6.html#%_idx_54"><tt>char?</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_466">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_630"><tt>close-input-port</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_632"><tt>close-output-port</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_94">combination</a><br>
<a href="r5rs-Z-H-7.html#%_idx_158">comma</a><br>
<a href="r5rs-Z-H-5.html#%_idx_22">comment</a><br>
<a href="r5rs-Z-H-9.html#%_idx_246"><tt>complex?</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_108"><tt>cond</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_408"><tt>cons</tt></a><br>
<a href="r5rs-Z-H-6.html#%_idx_72">constant</a><br>
<a href="r5rs-Z-H-9.html#%_idx_592">continuation</a><br>
<a href="r5rs-Z-H-9.html#%_idx_332"><tt>cos</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_618"><tt>current-input-port</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_620"><tt>current-output-port</tt></a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_236"><tt>#d</tt></a><br>
<a href="r5rs-Z-H-8.html#%_idx_194"><tt>define</tt></a><br>
<a href="r5rs-Z-H-8.html#%_idx_202"><tt>define-syntax</tt></a><br>
<a href="r5rs-Z-H-8.html#%_idx_192">definition</a><br>
<a href="r5rs-Z-H-7.html#%_idx_146"><tt>delay</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_312"><tt>denominator</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_656"><tt>display</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_658">[2]</a><br>
<a href="r5rs-Z-H-7.html#%_idx_140"><tt>do</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_392">dotted pair</a><br>
<a href="r5rs-Z-H-9.html#%_idx_598"><tt>dynamic-wind</tt></a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_240"><tt>#e</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_110"><tt>else</tt></a>, <a href="r5rs-Z-H-7.html#%_idx_118">[2]</a><br>
<a href="r5rs-Z-H-6.html#%_idx_64">empty list</a>, <a href="r5rs-Z-H-9.html#%_idx_384">[2]</a>,
<a href="r5rs-Z-H-9.html#%_idx_394">[3]</a>, <a href="r5rs-Z-H-9.html#%_idx_396">[4]</a>,
<a href="r5rs-Z-H-9.html#%_idx_398">[5]</a>, <a href="r5rs-Z-H-9.html#%_idx_412">[6]</a>,
<a href="r5rs-Z-H-9.html#%_idx_430">[7]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_646"><tt>eof-object?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_220"><tt>eq?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_222"><tt>equal?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_212">equivalence predicate</a><br>
<a href="r5rs-Z-H-9.html#%_idx_214"><tt>eqv?</tt></a>, <a href="r5rs-Z-H-10.html#%_idx_684">[2]</a><br>
<a href="r5rs-Z-H-4.html#%_idx_8">error</a><br>
<a href="r5rs-Z-H-9.html#%_idx_590">escape procedure</a><br>
<a href="r5rs-Z-H-9.html#%_idx_600"><tt>eval</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_276"><tt>even?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_216">exact</a><br>
<a href="r5rs-Z-H-9.html#%_idx_360"><tt>exact-&gt;inexact</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_254"><tt>exact?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_228">exactness</a><br>
<a href="r5rs-Z-H-9.html#%_idx_326"><tt>exp</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_346"><tt>expt</tt></a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_374"><tt>#f</tt></a><br>
<a href="r5rs-Z-H-6.html#%_idx_68">false</a>, <a href="r5rs-Z-H-9.html#%_idx_378">[2]</a>,
<a href="r5rs-Z-H-9.html#%_idx_382">[3]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_314"><tt>floor</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_582"><tt>for-each</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_584"><tt>force</tt></a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_306"><tt>gcd</tt></a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-7.html#%_idx_180">hygienic</a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_242"><tt>#i</tt></a><br>
<a href="r5rs-Z-H-5.html#%_idx_14">identifier</a>, <a href="r5rs-Z-H-6.html#%_idx_26">[2]</a>,
<a href="r5rs-Z-H-9.html#%_idx_458">[3]</a><br>
<a href="r5rs-Z-H-7.html#%_idx_98"><tt>if</tt></a>, <a href="r5rs-Z-H-7.html#%_idx_100">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_354"><tt>imag-part</tt></a><br>
<a href="r5rs-Z-H-6.html#%_idx_76">immutable</a><br>
<a href="r5rs-Z-H-4.html#%_idx_10">implementation restriction</a>,
<a href="r5rs-Z-H-9.html#%_idx_230">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_400">improper list</a><br>
<a href="r5rs-Z-H-9.html#%_idx_218">inexact</a><br>
<a href="r5rs-Z-H-9.html#%_idx_362"><tt>inexact-&gt;exact</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_256"><tt>inexact?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_204">initial environment</a><br>
<a href="r5rs-Z-H-9.html#%_idx_614"><tt>input-port?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_500"><tt>integer-&gt;char</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_252"><tt>integer?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_606"><tt>interaction-environment</tt></a><br>
<a href="r5rs-Z-H-8.html#%_idx_198">internal definition</a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-7.html#%_idx_170">keyword</a>, <a href="r5rs-Z-H-7.html#%_idx_178">[2]</a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-7.html#%_idx_96"><tt>lambda</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_148">lazy evaluation</a><br>
<a href="r5rs-Z-H-9.html#%_idx_308"><tt>lcm</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_436"><tt>length</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_126"><tt>let</tt></a>, <a href="r5rs-Z-H-7.html#%_idx_144">[2]</a><br>
<a href="r5rs-Z-H-7.html#%_idx_130"><tt>let*</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_184"><tt>let-syntax</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_134"><tt>letrec</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_186"><tt>letrec-syntax</tt></a><br>
<a href="r5rs-Z-H-4.html#%_idx_6">library</a><br>
<a href="r5rs-Z-H-9.html#%_idx_208">library procedure</a><br>
<a href="r5rs-Z-H-9.html#%_idx_434"><tt>list</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_548"><tt>list-&gt;string</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_572"><tt>list-&gt;vector</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_444"><tt>list-ref</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_442"><tt>list-tail</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_432"><tt>list?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_668"><tt>load</tt></a><br>
<a href="r5rs-Z-H-6.html#%_idx_70">location</a><br>
<a href="r5rs-Z-H-9.html#%_idx_328"><tt>log</tt></a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-7.html#%_idx_166">macro</a><br>
<a href="r5rs-Z-H-7.html#%_idx_172">macro keyword</a><br>
<a href="r5rs-Z-H-7.html#%_idx_176">macro transformer</a><br>
<a href="r5rs-Z-H-7.html#%_idx_174">macro use</a><br>
<a href="r5rs-Z-H-9.html#%_idx_356"><tt>magnitude</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_350"><tt>make-polar</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_348"><tt>make-rectangular</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_510"><tt>make-string</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_512">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_558"><tt>make-vector</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_560">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_580"><tt>map</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_278"><tt>max</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_450"><tt>member</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_446"><tt>memq</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_448"><tt>memv</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_280"><tt>min</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_304"><tt>modulo</tt></a><br>
<a href="r5rs-Z-H-6.html#%_idx_74">mutable</a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_272"><tt>negative?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_660"><tt>newline</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_662">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_386"><tt>not</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_604"><tt>null-environment</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_428"><tt>null?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_224">number</a><br>
<a href="r5rs-Z-H-9.html#%_idx_364"><tt>number-&gt;string</tt></a>,
<a href="r5rs-Z-H-9.html#%_idx_366">[2]</a><br>
<a href="r5rs-Z-H-6.html#%_idx_52"><tt>number?</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_244">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_310"><tt>numerator</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_226">numerical types</a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_234"><tt>#o</tt></a><br>
<a href="r5rs-Z-H-4.html#%_idx_2">object</a><br>
<a href="r5rs-Z-H-9.html#%_idx_274"><tt>odd?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_626"><tt>open-input-file</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_628"><tt>open-output-file</tt></a><br>
<a href="r5rs-Z-H-4.html#%_idx_4">optional</a><br>
<a href="r5rs-Z-H-7.html#%_idx_122"><tt>or</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_616"><tt>output-port?</tt></a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_390">pair</a><br>
<a href="r5rs-Z-H-6.html#%_idx_48"><tt>pair?</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_406">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_642"><tt>peek-char</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_644">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_608">port</a><br>
<a href="r5rs-Z-H-6.html#%_idx_60"><tt>port?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_270"><tt>positive?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_210">predicate</a><br>
<a href="r5rs-Z-H-7.html#%_idx_92">procedure call</a><br>
<a href="r5rs-Z-H-6.html#%_idx_62"><tt>procedure?</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_576">[2]</a><br>
<a href="r5rs-Z-H-7.html#%_idx_152">promise</a>, <a href="r5rs-Z-H-9.html#%_idx_586">[2]</a><br>
<a href="r5rs-Z-H-6.html#%_idx_78">proper tail recursion</a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-7.html#%_idx_154"><tt>quasiquote</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_86"><tt>quote</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_300"><tt>quotient</tt></a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_250"><tt>rational?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_322"><tt>rationalize</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_634"><tt>read</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_636">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_638"><tt>read-char</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_640">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_352"><tt>real-part</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_248"><tt>real?</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_182">referentially transparent</a><br>
<a href="r5rs-Z-H-6.html#%_idx_36">region</a>, <a href="r5rs-Z-H-7.html#%_idx_106">[2]</a>,
<a href="r5rs-Z-H-7.html#%_idx_124">[3]</a>, <a href="r5rs-Z-H-7.html#%_idx_128">[4]</a>,
<a href="r5rs-Z-H-7.html#%_idx_132">[5]</a>, <a href="r5rs-Z-H-7.html#%_idx_136">[6]</a>,
<a href="r5rs-Z-H-7.html#%_idx_142">[7]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_302"><tt>remainder</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_440"><tt>reverse</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_320"><tt>round</tt></a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_602"><tt>scheme-report-environment</tt></a><br>
<a href="r5rs-Z-H-7.html#%_idx_104"><tt>set!</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_416"><tt>set-car!</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_418"><tt>set-cdr!</tt></a><br>
<a href="r5rs-Z-H-10.html#%_idx_682"><tt>setcar</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_324">simplest rational</a><br>
<a href="r5rs-Z-H-9.html#%_idx_330"><tt>sin</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_344"><tt>sqrt</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_514"><tt>string</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_546"><tt>string-&gt;list</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_368"><tt>string-&gt;number</tt></a>,
<a href="r5rs-Z-H-9.html#%_idx_370">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_464"><tt>string-&gt;symbol</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_544"><tt>string-append</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_538"><tt>string-ci&lt;=?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_534"><tt>string-ci&lt;?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_524"><tt>string-ci=?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_540"><tt>string-ci&gt;=?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_536"><tt>string-ci&gt;?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_550"><tt>string-copy</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_552"><tt>string-fill!</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_516"><tt>string-length</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_518"><tt>string-ref</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_520"><tt>string-set!</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_530"><tt>string&lt;=?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_526"><tt>string&lt;?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_522"><tt>string=?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_532"><tt>string&gt;=?</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_528"><tt>string&gt;?</tt></a><br>
<a href="r5rs-Z-H-6.html#%_idx_56"><tt>string?</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_508">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_542"><tt>substring</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_462"><tt>symbol-&gt;string</tt></a><br>
<a href="r5rs-Z-H-6.html#%_idx_50"><tt>symbol?</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_460">[2]</a><br>
<a href="r5rs-Z-H-5.html#%_idx_18">syntactic keyword</a>,
<a href="r5rs-Z-H-6.html#%_idx_28">[2]</a>, <a href="r5rs-Z-H-7.html#%_idx_168">[3]</a><br>
<a href="r5rs-Z-H-8.html#%_idx_200">syntax definition</a><br>
<a href="r5rs-Z-H-7.html#%_idx_188"><tt>syntax-rules</tt></a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_372"><tt>#t</tt></a><br>
<a href="r5rs-Z-H-6.html#%_idx_80">tail call</a><br>
<a href="r5rs-Z-H-9.html#%_idx_334"><tt>tan</tt></a><br>
<a href="r5rs-Z-H-10.html#%_idx_674">token</a><br>
<a href="r5rs-Z-H-6.html#%_idx_42">top level environment</a>,
<a href="r5rs-Z-H-9.html#%_idx_206">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_672"><tt>transcript-off</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_670"><tt>transcript-on</tt></a><br>
<a href="r5rs-Z-H-6.html#%_idx_66">true</a>, <a href="r5rs-Z-H-7.html#%_idx_102">[2]</a>,
<a href="r5rs-Z-H-7.html#%_idx_114">[3]</a>, <a href="r5rs-Z-H-9.html#%_idx_376">[4]</a>,
<a href="r5rs-Z-H-9.html#%_idx_380">[5]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_318"><tt>truncate</tt></a><br>
<a href="r5rs-Z-H-6.html#%_idx_44">type</a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-6.html#%_idx_38">unbound</a>, <a href="r5rs-Z-H-7.html#%_idx_84">[2]</a>,
<a href="r5rs-Z-H-8.html#%_idx_196">[3]</a><br>
<a href="r5rs-Z-H-4.html#%_idx_12">unspecified</a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_506">valid indexes</a>,
<a href="r5rs-Z-H-9.html#%_idx_554">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_594"><tt>values</tt></a><br>
<a href="r5rs-Z-H-5.html#%_idx_16">variable</a>, <a href="r5rs-Z-H-6.html#%_idx_30">[2]</a>,
<a href="r5rs-Z-H-7.html#%_idx_82">[3]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_562"><tt>vector</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_570"><tt>vector-&gt;list</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_574"><tt>vector-fill!</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_564"><tt>vector-length</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_566"><tt>vector-ref</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_568"><tt>vector-set!</tt></a><br>
<a href="r5rs-Z-H-6.html#%_idx_58"><tt>vector?</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_556">[2]</a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-5.html#%_idx_20">Whitespace</a><br>
<a href="r5rs-Z-H-9.html#%_idx_622"><tt>with-input-from-file</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_624"><tt>with-output-to-file</tt></a><br>
<a href="r5rs-Z-H-9.html#%_idx_652"><tt>write</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_654">[2]</a><br>
<a href="r5rs-Z-H-9.html#%_idx_664"><tt>write-char</tt></a>, <a href="r5rs-Z-H-9.html#%_idx_666">[2]</a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_238"><tt>#x</tt></a></p>
<p>
</p>
<p></p>
<p>
<br>
<a href="r5rs-Z-H-9.html#%_idx_268"><tt>zero?</tt></a></p>
<p>
</p>
<p>
</p>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-14.html">previous</a></span><span class=disable>, next</span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span class=disable><span>; &nbsp;&nbsp;</span>index</span>]</div>
<p></p>
</body>
</html>

View File

@ -0,0 +1,146 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="noindex,follow">
</head>
<body>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-1.html">previous</a></span><span>, <a href="r5rs-Z-H-3.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span class=disable>contents</span><span><span class=disable>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
<a name="%_chap_Temp_2"></a>
<h1 class=chapter>
<div class=chapterheading>&nbsp;</div><br>
Contents</h1>
<p></p>
<p></p>
<p> <a name="%_toc_start"></p>
<p><b>
&nbsp; &nbsp; <a name="%_toc_%_chap_Temp_3" href="r5rs-Z-H-3.html#%_chap_Temp_3">Introduction</a></b><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_Temp_4" href="r5rs-Z-H-3.html#%_sec_Temp_4">Background</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_Temp_5" href="r5rs-Z-H-3.html#%_sec_Temp_5">Acknowledgements</a><br>
</p>
<p><b>
&nbsp; &nbsp; <a name="%_toc_%_chap_1" href="r5rs-Z-H-4.html#%_chap_1">1&nbsp;&nbsp;Overview of Scheme</a></b><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_1.1" href="r5rs-Z-H-4.html#%_sec_1.1">1.1&nbsp;&nbsp;Semantics</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_1.2" href="r5rs-Z-H-4.html#%_sec_1.2">1.2&nbsp;&nbsp;Syntax</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_1.3" href="r5rs-Z-H-4.html#%_sec_1.3">1.3&nbsp;&nbsp;Notation and terminology</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_1.3.1" href="r5rs-Z-H-4.html#%_sec_1.3.1">1.3.1&nbsp;&nbsp;Primitive, library, and optional features</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_1.3.2" href="r5rs-Z-H-4.html#%_sec_1.3.2">1.3.2&nbsp;&nbsp;Error situations and unspecified behavior</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_1.3.3" href="r5rs-Z-H-4.html#%_sec_1.3.3">1.3.3&nbsp;&nbsp;Entry format</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_1.3.4" href="r5rs-Z-H-4.html#%_sec_1.3.4">1.3.4&nbsp;&nbsp;Evaluation examples</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_1.3.5" href="r5rs-Z-H-4.html#%_sec_1.3.5">1.3.5&nbsp;&nbsp;Naming conventions</a><br>
</p>
<p><b>
&nbsp; &nbsp; <a name="%_toc_%_chap_2" href="r5rs-Z-H-5.html#%_chap_2">2&nbsp;&nbsp;Lexical conventions</a></b><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_2.1" href="r5rs-Z-H-5.html#%_sec_2.1">2.1&nbsp;&nbsp;Identifiers</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_2.2" href="r5rs-Z-H-5.html#%_sec_2.2">2.2&nbsp;&nbsp;Whitespace and comments</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_2.3" href="r5rs-Z-H-5.html#%_sec_2.3">2.3&nbsp;&nbsp;Other notations</a><br>
</p>
<p><b>
&nbsp; &nbsp; <a name="%_toc_%_chap_3" href="r5rs-Z-H-6.html#%_chap_3">3&nbsp;&nbsp;Basic concepts</a></b><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_3.1" href="r5rs-Z-H-6.html#%_sec_3.1">3.1&nbsp;&nbsp;Variables, syntactic keywords, and regions</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_3.2" href="r5rs-Z-H-6.html#%_sec_3.2">3.2&nbsp;&nbsp;Disjointness of types</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_3.3" href="r5rs-Z-H-6.html#%_sec_3.3">3.3&nbsp;&nbsp;External representations</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_3.4" href="r5rs-Z-H-6.html#%_sec_3.4">3.4&nbsp;&nbsp;Storage model</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_3.5" href="r5rs-Z-H-6.html#%_sec_3.5">3.5&nbsp;&nbsp;Proper tail recursion</a><br>
</p>
<p><b>
&nbsp; &nbsp; <a name="%_toc_%_chap_4" href="r5rs-Z-H-7.html#%_chap_4">4&nbsp;&nbsp;Expressions</a></b><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.1" href="r5rs-Z-H-7.html#%_sec_4.1">4.1&nbsp;&nbsp;Primitive expression types</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.1.1" href="r5rs-Z-H-7.html#%_sec_4.1.1">4.1.1&nbsp;&nbsp;Variable references</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.1.2" href="r5rs-Z-H-7.html#%_sec_4.1.2">4.1.2&nbsp;&nbsp;Literal expressions</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.1.3" href="r5rs-Z-H-7.html#%_sec_4.1.3">4.1.3&nbsp;&nbsp;Procedure calls</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.1.4" href="r5rs-Z-H-7.html#%_sec_4.1.4">4.1.4&nbsp;&nbsp;Procedures</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.1.5" href="r5rs-Z-H-7.html#%_sec_4.1.5">4.1.5&nbsp;&nbsp;Conditionals</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.1.6" href="r5rs-Z-H-7.html#%_sec_4.1.6">4.1.6&nbsp;&nbsp;Assignments</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.2" href="r5rs-Z-H-7.html#%_sec_4.2">4.2&nbsp;&nbsp;Derived expression types</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.2.1" href="r5rs-Z-H-7.html#%_sec_4.2.1">4.2.1&nbsp;&nbsp;Conditionals</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.2.2" href="r5rs-Z-H-7.html#%_sec_4.2.2">4.2.2&nbsp;&nbsp;Binding constructs</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.2.3" href="r5rs-Z-H-7.html#%_sec_4.2.3">4.2.3&nbsp;&nbsp;Sequencing</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.2.4" href="r5rs-Z-H-7.html#%_sec_4.2.4">4.2.4&nbsp;&nbsp;Iteration</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.2.5" href="r5rs-Z-H-7.html#%_sec_4.2.5">4.2.5&nbsp;&nbsp;Delayed evaluation</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.2.6" href="r5rs-Z-H-7.html#%_sec_4.2.6">4.2.6&nbsp;&nbsp;Quasiquotation</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.3" href="r5rs-Z-H-7.html#%_sec_4.3">4.3&nbsp;&nbsp;Macros</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.3.1" href="r5rs-Z-H-7.html#%_sec_4.3.1">4.3.1&nbsp;&nbsp;Binding constructs for syntactic keywords</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_4.3.2" href="r5rs-Z-H-7.html#%_sec_4.3.2">4.3.2&nbsp;&nbsp;Pattern language</a><br>
</p>
<p><b>
&nbsp; &nbsp; <a name="%_toc_%_chap_5" href="r5rs-Z-H-8.html#%_chap_5">5&nbsp;&nbsp;Program structure</a></b><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_5.1" href="r5rs-Z-H-8.html#%_sec_5.1">5.1&nbsp;&nbsp;Programs</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_5.2" href="r5rs-Z-H-8.html#%_sec_5.2">5.2&nbsp;&nbsp;Definitions</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_5.2.1" href="r5rs-Z-H-8.html#%_sec_5.2.1">5.2.1&nbsp;&nbsp;Top level definitions</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_5.2.2" href="r5rs-Z-H-8.html#%_sec_5.2.2">5.2.2&nbsp;&nbsp;Internal definitions</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_5.3" href="r5rs-Z-H-8.html#%_sec_5.3">5.3&nbsp;&nbsp;Syntax definitions</a><br>
</p>
<p><b>
&nbsp; &nbsp; <a name="%_toc_%_chap_6" href="r5rs-Z-H-9.html#%_chap_6">6&nbsp;&nbsp;Standard procedures</a></b><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.1" href="r5rs-Z-H-9.html#%_sec_6.1">6.1&nbsp;&nbsp;Equivalence predicates</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.2" href="r5rs-Z-H-9.html#%_sec_6.2">6.2&nbsp;&nbsp;Numbers</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.2.1" href="r5rs-Z-H-9.html#%_sec_6.2.1">6.2.1&nbsp;&nbsp;Numerical types</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.2.2" href="r5rs-Z-H-9.html#%_sec_6.2.2">6.2.2&nbsp;&nbsp;Exactness</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.2.3" href="r5rs-Z-H-9.html#%_sec_6.2.3">6.2.3&nbsp;&nbsp;Implementation restrictions</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.2.4" href="r5rs-Z-H-9.html#%_sec_6.2.4">6.2.4&nbsp;&nbsp;Syntax of numerical constants</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.2.5" href="r5rs-Z-H-9.html#%_sec_6.2.5">6.2.5&nbsp;&nbsp;Numerical operations</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.2.6" href="r5rs-Z-H-9.html#%_sec_6.2.6">6.2.6&nbsp;&nbsp;Numerical input and output</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.3" href="r5rs-Z-H-9.html#%_sec_6.3">6.3&nbsp;&nbsp;Other data types</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.3.1" href="r5rs-Z-H-9.html#%_sec_6.3.1">6.3.1&nbsp;&nbsp;Booleans</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.3.2" href="r5rs-Z-H-9.html#%_sec_6.3.2">6.3.2&nbsp;&nbsp;Pairs and lists</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.3.3" href="r5rs-Z-H-9.html#%_sec_6.3.3">6.3.3&nbsp;&nbsp;Symbols</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.3.4" href="r5rs-Z-H-9.html#%_sec_6.3.4">6.3.4&nbsp;&nbsp;Characters</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.3.5" href="r5rs-Z-H-9.html#%_sec_6.3.5">6.3.5&nbsp;&nbsp;Strings</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.3.6" href="r5rs-Z-H-9.html#%_sec_6.3.6">6.3.6&nbsp;&nbsp;Vectors</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.4" href="r5rs-Z-H-9.html#%_sec_6.4">6.4&nbsp;&nbsp;Control features</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.5" href="r5rs-Z-H-9.html#%_sec_6.5">6.5&nbsp;&nbsp;<tt>Eval</tt></a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.6" href="r5rs-Z-H-9.html#%_sec_6.6">6.6&nbsp;&nbsp;Input and output</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.6.1" href="r5rs-Z-H-9.html#%_sec_6.6.1">6.6.1&nbsp;&nbsp;Ports</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.6.2" href="r5rs-Z-H-9.html#%_sec_6.6.2">6.6.2&nbsp;&nbsp;Input</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.6.3" href="r5rs-Z-H-9.html#%_sec_6.6.3">6.6.3&nbsp;&nbsp;Output</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_6.6.4" href="r5rs-Z-H-9.html#%_sec_6.6.4">6.6.4&nbsp;&nbsp;System interface</a><br>
</p>
<p><b>
&nbsp; &nbsp; <a name="%_toc_%_chap_7" href="r5rs-Z-H-10.html#%_chap_7">7&nbsp;&nbsp;Formal syntax and semantics</a></b><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_7.1" href="r5rs-Z-H-10.html#%_sec_7.1">7.1&nbsp;&nbsp;Formal syntax</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_7.1.1" href="r5rs-Z-H-10.html#%_sec_7.1.1">7.1.1&nbsp;&nbsp;Lexical structure</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_7.1.2" href="r5rs-Z-H-10.html#%_sec_7.1.2">7.1.2&nbsp;&nbsp;External representations</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_7.1.3" href="r5rs-Z-H-10.html#%_sec_7.1.3">7.1.3&nbsp;&nbsp;Expressions</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_7.1.4" href="r5rs-Z-H-10.html#%_sec_7.1.4">7.1.4&nbsp;&nbsp;Quasiquotations</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_7.1.5" href="r5rs-Z-H-10.html#%_sec_7.1.5">7.1.5&nbsp;&nbsp;Transformers</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_7.1.6" href="r5rs-Z-H-10.html#%_sec_7.1.6">7.1.6&nbsp;&nbsp;Programs and definitions</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_7.2" href="r5rs-Z-H-10.html#%_sec_7.2">7.2&nbsp;&nbsp;Formal semantics</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_7.2.1" href="r5rs-Z-H-10.html#%_sec_7.2.1">7.2.1&nbsp;&nbsp;Abstract syntax</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_7.2.2" href="r5rs-Z-H-10.html#%_sec_7.2.2">7.2.2&nbsp;&nbsp;Domain equations</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_7.2.3" href="r5rs-Z-H-10.html#%_sec_7.2.3">7.2.3&nbsp;&nbsp;Semantic functions</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_7.2.4" href="r5rs-Z-H-10.html#%_sec_7.2.4">7.2.4&nbsp;&nbsp;Auxiliary functions</a><br>
&nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_7.3" href="r5rs-Z-H-10.html#%_sec_7.3">7.3&nbsp;&nbsp;Derived expression types</a><br>
</p>
<p><b>
&nbsp; &nbsp; <a name="%_toc_%_chap_Temp_6" href="r5rs-Z-H-11.html#%_chap_Temp_6">Notes</a></b><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a name="%_toc_%_sec_Temp_7" href="r5rs-Z-H-11.html#%_sec_Temp_7">Language changes</a><br>
</p>
<p><b>
&nbsp; &nbsp; <a name="%_toc_%_chap_Temp_8" href="r5rs-Z-H-12.html#%_chap_Temp_8">Additional material</a></b><br>
</p>
<p><b>
&nbsp; &nbsp; <a name="%_toc_%_chap_Temp_9" href="r5rs-Z-H-13.html#%_chap_Temp_9">Example</a></b><br>
</p>
<p><b>
&nbsp; &nbsp; <a name="%_toc_%_chap_Temp_10" href="r5rs-Z-H-14.html#%_chap_Temp_10">Bibliography</a></b><br>
</p>
<p><b>
&nbsp; &nbsp; <a name="%_toc_%_chap_Temp_11" href="r5rs-Z-H-15.html#%_chap_Temp_11">Alphabetic Index of Definitions of Concepts,
Keywords, and Procedures</a></b><br>
</p>
<p>
</p>
<p>
</p>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-1.html">previous</a></span><span>, <a href="r5rs-Z-H-3.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span class=disable>contents</span><span><span class=disable>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
</body>
</html>

View File

@ -0,0 +1,135 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="noindex,follow">
</head>
<body>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-2.html">previous</a></span><span>, <a href="r5rs-Z-H-4.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
<a name="%_chap_Temp_3"></a>
<h1 class=chapter>
<div class=chapterheading>&nbsp;</div><br>
<a href="r5rs-Z-H-2.html#%_toc_%_chap_Temp_3">Introduction</a></h1>
<p>
</p>
<p>
</p>
<p>
Programming languages should be designed not by piling feature on top of
feature, but by removing the weaknesses and restrictions that make additional
features appear necessary. Scheme demonstrates that a very small number
of rules for forming expressions, with no restrictions on how they are
composed, suffice to form a practical and efficient programming language
that is flexible enough to support most of the major programming
paradigms in use today.</p>
<p>
Scheme
was one of the first programming languages to incorporate first class
procedures as in the lambda calculus, thereby proving the usefulness of
static scope rules and block structure in a dynamically typed language.
Scheme was the first major dialect of Lisp to distinguish procedures
from lambda expressions and symbols, to use a single lexical
environment for all variables, and to evaluate the operator position
of a procedure call in the same way as an operand position. By relying
entirely on procedure calls to express iteration, Scheme emphasized the
fact that tail-recursive procedure calls are essentially goto's that
pass arguments. Scheme was the first widely used programming language to
embrace first class escape procedures, from which all previously known
sequential control structures can be synthesized. A subsequent
version of Scheme introduced the concept of exact and inexact numbers,
an extension of Common Lisp's generic arithmetic.
More recently, Scheme became the first programming language to support
hygienic macros, which permit the syntax of a block-structured language
to be extended in a consistent and reliable manner.
</p>
<p>
</p>
<a name="%_sec_Temp_4"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_Temp_4">Background</a></h3>
<p>The first description of Scheme was written in
1975&nbsp;[<a href="r5rs-Z-H-14.html#cite{Scheme75}">28</a>]. A revised report&nbsp;[<a href="r5rs-Z-H-14.html#cite{Scheme78}">25</a>]
appeared in 1978, which described the evolution
of the language as its MIT implementation was upgraded to support an
innovative compiler&nbsp;[<a href="r5rs-Z-H-14.html#cite{Rabbit}">26</a>]. Three distinct projects began in
1981 and 1982 to use variants of Scheme for courses at MIT, Yale, and
Indiana University&nbsp;[<a href="r5rs-Z-H-14.html#cite{Rees82}">21</a>,&nbsp;<a href="r5rs-Z-H-14.html#cite{MITScheme}">17</a>,&nbsp;<a href="r5rs-Z-H-14.html#cite{Scheme311}">10</a>]. An introductory
computer science textbook using Scheme was published in
1984&nbsp;[<a href="r5rs-Z-H-14.html#cite{SICP}">1</a>].</p>
<p>
As Scheme became more widespread,
local dialects began to diverge until students and researchers
occasionally found it difficult to understand code written at other
sites.
Fifteen representatives of the major implementations of Scheme therefore
met in October 1984 to work toward a better and more widely accepted
standard for Scheme.
Their report&nbsp;[<a href="r5rs-Z-H-14.html#cite{RRRS}">4</a>]
was published at MIT and Indiana University in the summer of 1985.
Further revision took place in the spring of 1986&nbsp;[<a href="r5rs-Z-H-14.html#cite{R3RS}">23</a>],
and in the spring of 1988&nbsp;[<a href="r5rs-Z-H-14.html#cite{R4RS}">6</a>].
The present report reflects further revisions agreed upon in a meeting
at Xerox PARC in June 1992.</p>
<p>
</p>
<p>
</p>
<p></p>
<p></p>
<p>
We intend this report to belong to the entire Scheme community, and so
we grant permission to copy it in whole or in part without fee. In
particular, we encourage implementors of Scheme to use this report as
a starting point for manuals and other documentation, modifying it as
necessary.</p>
<p>
</p>
<a name="%_sec_Temp_5"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_Temp_5">Acknowledgements</a></h3>
<p>We would like to thank the following people for their help: Alan Bawden, Michael
Blair, George Carrette, Andy Cromarty, Pavel Curtis, Jeff Dalton, Olivier Danvy,
Ken Dickey, Bruce Duba, Marc Feeley,
Andy Freeman, Richard Gabriel, Yekta G&uuml;rsel, Ken Haase, Robert
Hieb, Paul Hudak, Morry Katz, Chris Lindblad, Mark Meyer, Jim Miller, Jim Philbin,
John Ramsdell, Mike Shaff, Jonathan Shapiro, Julie Sussman,
Perry Wagle, Daniel Weise, Henry Wu, and Ozan Yigit.
We thank Carol Fessenden, Daniel
Friedman, and Christopher Haynes for permission to use text from the Scheme 311
version 4 reference manual. We thank Texas Instruments, Inc.&nbsp;for permission to
use text from the <em>TI Scheme Language Reference Manual</em>[<a href="r5rs-Z-H-14.html#cite{TImanual85}">30</a>].
We gladly acknowledge the influence of manuals for MIT Scheme[<a href="r5rs-Z-H-14.html#cite{MITScheme}">17</a>],
T[<a href="r5rs-Z-H-14.html#cite{Rees84}">22</a>], Scheme 84[<a href="r5rs-Z-H-14.html#cite{Scheme84}">11</a>],Common Lisp[<a href="r5rs-Z-H-14.html#cite{CLtL}">27</a>],
and Algol 60[<a href="r5rs-Z-H-14.html#cite{Naur63}">18</a>].</p>
<p>
We also thank Betty Dexter for the extreme effort she put into
setting this report in T<small>E</small>X, and Donald Knuth for designing the program
that caused her troubles.</p>
<p>
The Artificial Intelligence Laboratory of the
Massachusetts Institute of Technology, the Computer Science
Department of Indiana University, the Computer and Information
Sciences Department of the University of Oregon, and the NEC Research
Institute supported the preparation of this report. Support for the MIT
work was provided in part by
the Advanced Research Projects Agency of the Department of Defense under Office
of Naval Research contract N00014-80-C-0505. Support for the Indiana
University work was provided by NSF grants NCS 83-04567 and NCS
83-03325.</p>
<p>
</p>
<p></p>
<p></p>
<p>
</p>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-2.html">previous</a></span><span>, <a href="r5rs-Z-H-4.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
</body>
</html>

View File

@ -0,0 +1,300 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="noindex,follow">
</head>
<body>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-3.html">previous</a></span><span>, <a href="r5rs-Z-H-5.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
<a name="%_chap_1"></a>
<h1 class=chapter>
<div class=chapterheading><a href="r5rs-Z-H-2.html#%_toc_%_chap_1">Chapter 1</a></div><br>
<a href="r5rs-Z-H-2.html#%_toc_%_chap_1">Overview of Scheme</a></h1>
<p></p>
<a name="%_sec_1.1"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_1.1">1.1&nbsp;&nbsp;Semantics</a></h2>
<p></p>
<p>
This section gives an overview of Scheme's semantics. A
detailed informal semantics is the subject of
chapters&nbsp;<a href="r5rs-Z-H-6.html#%_chap_3">3</a> through&nbsp;<a href="r5rs-Z-H-9.html#%_chap_6">6</a>. For reference
purposes, section&nbsp;<a href="r5rs-Z-H-10.html#%_sec_7.2">7.2</a> provides a formal
semantics of Scheme.</p>
<p>
Following Algol, Scheme is a statically scoped programming
language. Each use of a variable is associated with a lexically
apparent binding of that variable.</p>
<p>
Scheme has latent as opposed to manifest types. Types
are associated with values (also called objects<a name="%_idx_2"></a>) rather than
with variables. (Some authors refer to languages with latent types as
weakly typed or dynamically typed languages.) Other languages with
latent types are APL, Snobol, and other dialects of Lisp. Languages
with manifest types (sometimes referred to as strongly typed or
statically typed languages) include Algol 60, Pascal, and&nbsp;C.</p>
<p>
All objects created in the course of a Scheme computation, including
procedures and continuations, have unlimited extent.
No Scheme object is ever destroyed. The reason that
implementations of Scheme do not (usually!) run out of storage is that
they are permitted to reclaim the storage occupied by an object if
they can prove that the object cannot possibly matter to any future
computation. Other languages in which most objects have unlimited
extent include APL and other Lisp dialects.</p>
<p>
Implementations of Scheme are required to be properly tail-recursive.
This allows the execution of an iterative computation in constant space,
even if the iterative computation is described by a syntactically
recursive procedure. Thus with a properly tail-recursive implementation,
iteration can be expressed using the ordinary procedure-call
mechanics, so that special iteration constructs are useful only as
syntactic sugar. See section&nbsp;<a href="r5rs-Z-H-6.html#%_sec_3.5">3.5</a>.</p>
<p>
Scheme procedures are objects in their own right. Procedures can be
created dynamically, stored in data structures, returned as results of
procedures, and so on. Other languages with these properties include
Common Lisp and ML. </p>
<p>
One distinguishing feature of Scheme is that continuations, which
in most other languages only operate behind the scenes, also have
``first-class'' status. Continuations are useful for implementing a
wide variety of advanced control constructs, including non-local exits,
backtracking, and coroutines. See section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.4">6.4</a>.</p>
<p>
Arguments to Scheme procedures are always passed by value, which
means that the actual argument expressions are evaluated before the
procedure gains control, whether the procedure needs the result of the
evaluation or not. ML, C, and APL are three other languages that always
pass arguments by value.
This is distinct from the lazy-evaluation semantics of Haskell,
or the call-by-name semantics of Algol 60, where an argument
expression is not evaluated unless its value is needed by the
procedure.</p>
<p>
</p>
<p>
Scheme's model of arithmetic is designed to remain as independent as
possible of the particular ways in which numbers are represented within a
computer. In Scheme, every integer is a rational number, every rational is a
real, and every real is a complex number. Thus the distinction between integer
and real arithmetic, so important to many programming languages, does not
appear in Scheme. In its place is a distinction between exact arithmetic,
which corresponds to the mathematical ideal, and inexact arithmetic on
approximations. As in Common Lisp, exact arithmetic is not limited to
integers.</p>
<p>
</p>
<a name="%_sec_1.2"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_1.2">1.2&nbsp;&nbsp;Syntax</a></h2>
<p>Scheme, like most dialects of Lisp, employs a fully parenthesized prefix
notation for programs and (other) data; the grammar of Scheme generates a
sublanguage of the language used for data. An important
consequence of this simple, uniform representation is the susceptibility of
Scheme programs and data to uniform treatment by other Scheme programs.
For example, the <tt>eval</tt> procedure evaluates a Scheme program expressed
as data.</p>
<p>
The <tt>read</tt> procedure performs syntactic as well as lexical decomposition of
the data it reads. The <tt>read</tt> procedure parses its input as data
(section&nbsp;<a href="r5rs-Z-H-10.html#%_sec_7.1.2">7.1.2</a>), not as program.</p>
<p>
The formal syntax of Scheme is described in section&nbsp;<a href="r5rs-Z-H-10.html#%_sec_7.1">7.1</a>.</p>
<p>
</p>
<a name="%_sec_1.3"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_1.3">1.3&nbsp;&nbsp;Notation and terminology</a></h2>
<p></p>
<a name="%_sec_1.3.1"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_1.3.1">1.3.1&nbsp;&nbsp;Primitive, library, and optional features</a></h3>
<p></p>
<p>
It is required that every implementation of Scheme support all
features that are not marked as being <a name="%_idx_4"></a><em>optional</em>. Implementations are
free to omit optional features of Scheme or to add extensions,
provided the extensions are not in conflict with the language reported
here. In particular, implementations must support portable code by
providing a syntactic mode that preempts no lexical conventions of this
report.</p>
<p>
To aid in understanding and implementing Scheme, some features are marked
as <a name="%_idx_6"></a><em>library</em>. These can be easily implemented in terms of the other,
primitive, features. They are redundant in the strict sense of
the word, but they capture common patterns of usage, and are therefore
provided as convenient abbreviations.</p>
<p>
</p>
<a name="%_sec_1.3.2"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_1.3.2">1.3.2&nbsp;&nbsp;Error situations and unspecified behavior</a></h3>
<p><a name="%_idx_8"></a>
When speaking of an error situation, this report uses the phrase ``an
error is signalled'' to indicate that implementations must detect and
report the error. If such wording does not appear in the discussion of
an error, then implementations are not required to detect or report the
error, though they are encouraged to do so. An error situation that
implementations are not required to detect is usually referred to simply
as ``an error.''</p>
<p>
For example, it is an error for a procedure to be passed an argument that
the procedure is not explicitly specified to handle, even though such
domain errors are seldom mentioned in this report. Implementations may
extend a procedure's domain of definition to include such arguments.</p>
<p>
This report uses the phrase ``may report a violation of an
implementation restriction'' to indicate circumstances under which an
implementation is permitted to report that it is unable to continue
execution of a correct program because of some restriction imposed by the
implementation. Implementation restrictions are of course discouraged,
but implementations are encouraged to report violations of implementation
restrictions.<a name="%_idx_10"></a></p>
<p>
For example, an implementation may report a violation of an
implementation restriction if it does not have enough storage to run a
program.</p>
<p>
If the value of an expression is said to be ``unspecified,'' then
the expression must evaluate to some object without signalling an error,
but the value depends on the implementation; this report explicitly does
not say what value should be returned. <a name="%_idx_12"></a></p>
<p>
</p>
<p>
</p>
<p>
</p>
<a name="%_sec_1.3.3"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_1.3.3">1.3.3&nbsp;&nbsp;Entry format</a></h3>
<p>Chapters&nbsp;<a href="r5rs-Z-H-7.html#%_chap_4">4</a> and&nbsp;<a href="r5rs-Z-H-9.html#%_chap_6">6</a> are organized
into entries. Each entry describes one language feature or a group of
related features, where a feature is either a syntactic construct or a
built-in procedure. An entry begins with one or more header lines of the form</p>
<p>
</p>
<div align=left><u><i>category</i>:</u>&nbsp;&nbsp;<tt><i>template</i></tt>&nbsp;</div>
<p>
for required, primitive features, or</p>
<p>
</p>
<div align=left><u><i>qualifier</i> <i>category</i>:</u>&nbsp;&nbsp;<tt><i>template</i></tt>&nbsp;</div>
<p>
where <i>qualifier</i> is either ``library'' or ``optional'' as defined
in section&nbsp;<a href="#%_sec_1.3.1">1.3.1</a>.</p>
<p>
If <i>category</i> is ``syntax'', the entry describes an expression
type, and the template gives the syntax of the expression type.
Components of expressions are designated by syntactic variables, which
are written using angle brackets, for example, &lt;expression&gt;,
&lt;variable&gt;. Syntactic variables should be understood to denote segments of
program text; for example, &lt;expression&gt; stands for any string of
characters which is a syntactically valid expression. The notation
</p>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;thing<sub>1</sub>&gt; <tt>...</tt>
</p>
<p>
indicates zero or more occurrences of a &lt;thing&gt;, and
</p>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;thing<sub>1</sub>&gt; &lt;thing<sub>2</sub>&gt; <tt>...</tt>
</p>
<p>
indicates one or more occurrences of a &lt;thing&gt;.</p>
<p>
If <i>category</i> is ``procedure'', then the entry describes a procedure, and
the header line gives a template for a call to the procedure. Argument
names in the template are <i>italicized</i>. Thus the header line</p>
<p>
</p>
<div align=left><u>procedure:</u>&nbsp;&nbsp;<tt>(vector-ref <i>vector</i> <i>k</i>)</tt>&nbsp;</div>
<p>
indicates that the built-in procedure <tt>vector-ref</tt> takes
two arguments, a vector <i>vector</i> and an exact non-negative integer
<i>k</i> (see below). The header lines</p>
<p>
</p>
<div align=left><u>procedure:</u>&nbsp;&nbsp;<tt>(make-vector <i>k</i>)</tt>&nbsp;</div>
<div align=left><u>procedure:</u>&nbsp;&nbsp;<tt>(make-vector <i>k</i> <i>fill</i>)</tt>&nbsp;</div>
<p>
indicate that the <tt>make-vector</tt> procedure must be defined to take
either one or two arguments.</p>
<p>
It is an error for an operation to be presented with an argument that it
is not specified to handle. For succinctness, we follow the convention
that if an argument name is also the name of a type listed in
section&nbsp;<a href="r5rs-Z-H-6.html#%_sec_3.2">3.2</a>, then that argument must be of the named type.
For example, the header line for <tt>vector-ref</tt> given above dictates that the
first argument to <tt>vector-ref</tt> must be a vector. The following naming
conventions also imply type restrictions:
</p>
<div align=left><table><tr><td>
<table border=0><tr><td valign=top ><i>obj</i></td><td valign=top >any object</td></tr>
<tr><td valign=top ><em>l</em><em>i</em><em>s</em><em>t</em>, <em>l</em><em>i</em><em>s</em><em>t</em><sub>1</sub>, <tt>...</tt> <em>l</em><em>i</em><em>s</em><em>t</em><sub><em>j</em></sub>, <tt>...</tt></td><td valign=top >list (see section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.3.2">6.3.2</a>)</td></tr>
<tr><td valign=top ><em>z</em>, <em>z</em><sub>1</sub>, <tt>...</tt> <em>z</em><sub><em>j</em></sub>, <tt>...</tt></td><td valign=top >complex number</td></tr>
<tr><td valign=top ><em>x</em>, <em>x</em><sub>1</sub>, <tt>...</tt> <em>x</em><sub><em>j</em></sub>, <tt>...</tt></td><td valign=top >real number</td></tr>
<tr><td valign=top ><em>y</em>, <em>y</em><sub>1</sub>, <tt>...</tt> <em>y</em><sub><em>j</em></sub>, <tt>...</tt></td><td valign=top >real number</td></tr>
<tr><td valign=top ><em>q</em>, <em>q</em><sub>1</sub>, <tt>...</tt> <em>q</em><sub><em>j</em></sub>, <tt>...</tt></td><td valign=top >rational number</td></tr>
<tr><td valign=top ><em>n</em>, <em>n</em><sub>1</sub>, <tt>...</tt> <em>n</em><sub><em>j</em></sub>, <tt>...</tt></td><td valign=top >integer</td></tr>
<tr><td valign=top ><em>k</em>, <em>k</em><sub>1</sub>, <tt>...</tt> <em>k</em><sub><em>j</em></sub>, <tt>...</tt></td><td valign=top >exact non-negative integer</td></tr>
<tr><td valign=top ></td></tr></table>
</td></tr></table></div>
<p></p>
<p>
</p>
<p>
</p>
<a name="%_sec_1.3.4"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_1.3.4">1.3.4&nbsp;&nbsp;Evaluation examples</a></h3>
<p>The symbol ``===&gt;'' used in program examples should be read
``evaluates to.'' For example,</p>
<p>
<tt>(*&nbsp;5&nbsp;8)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;===&gt;&nbsp;&nbsp;40</p>
</tt>
<p>
means that the expression <tt>(* 5 8)</tt> evaluates to the object <tt>40</tt>.
Or, more precisely: the expression given by the sequence of characters
``<tt>(* 5 8)</tt>'' evaluates, in the initial environment, to an object
that may be represented externally by the sequence of characters ``<tt>40</tt>''. See section&nbsp;<a href="r5rs-Z-H-6.html#%_sec_3.3">3.3</a> for a discussion of external
representations of objects.</p>
<p>
</p>
<a name="%_sec_1.3.5"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_1.3.5">1.3.5&nbsp;&nbsp;Naming conventions</a></h3>
<p>By convention, the names of procedures that always return a boolean
value usually end
in ``<tt>?</tt>''. Such procedures are called predicates.</p>
<p>
By convention, the names of procedures that store values into previously
allocated locations (see section&nbsp;<a href="r5rs-Z-H-6.html#%_sec_3.4">3.4</a>) usually end in
``<tt>!</tt>''.
Such procedures are called mutation procedures.
By convention, the value returned by a mutation procedure is unspecified.</p>
<p>
By convention, ``<tt>-&gt;</tt>'' appears within the names of procedures that
take an object of one type and return an analogous object of another type.
For example, <tt>list-&gt;vector</tt> takes a list and returns a vector whose
elements are the same as those of the list.</p>
<p>
</p>
<p>
</p>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-3.html">previous</a></span><span>, <a href="r5rs-Z-H-5.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
</body>
</html>

View File

@ -0,0 +1,201 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="noindex,follow">
</head>
<body>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-4.html">previous</a></span><span>, <a href="r5rs-Z-H-6.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
<a name="%_chap_2"></a>
<h1 class=chapter>
<div class=chapterheading><a href="r5rs-Z-H-2.html#%_toc_%_chap_2">Chapter 2</a></div><br>
<a href="r5rs-Z-H-2.html#%_toc_%_chap_2">Lexical conventions</a></h1>
<p>This section gives an informal account of some of the lexical
conventions used in writing Scheme programs. For a formal syntax of
Scheme, see section&nbsp;<a href="r5rs-Z-H-10.html#%_sec_7.1">7.1</a>.</p>
<p>
Upper and lower case forms of a letter are never distinguished
except within character and string constants. For example, <tt>Foo</tt> is
the same identifier as <tt>FOO</tt>, and <tt>#x1AB</tt> is the same number as
<tt>#X1ab</tt>.</p>
<p>
</p>
<a name="%_sec_2.1"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_2.1">2.1&nbsp;&nbsp;Identifiers</a></h2>
<p></p>
<p>
Most identifiers<a name="%_idx_14"></a> allowed by other programming
languages are also acceptable to Scheme. The precise rules for forming
identifiers vary among implementations of Scheme, but in all
implementations a sequence of letters, digits, and ``extended alphabetic
characters'' that begins with a character that cannot begin a number is
an identifier. In addition, <tt>+</tt>, <tt>-</tt>, and <tt>...</tt> are identifiers.
Here are some examples of identifiers:</p>
<p>
<tt>lambda&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q<br>
list-&gt;vector&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;soup<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;V17a<br>
&lt;=?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a34kTMNs<br>
the-word-recursion-has-many-meanings</p>
</tt>
<p>
Extended alphabetic characters may be used within identifiers as if
they were letters. The following are extended alphabetic characters:</p>
<p>
<tt>! $&nbsp;%&nbsp;<code class=verbatim>&amp;</code>&nbsp;*&nbsp;+&nbsp;-&nbsp;.&nbsp;/&nbsp;: &lt;&nbsp;=&nbsp;&gt;&nbsp;?&nbsp;@&nbsp;<code class=verbatim>^</code>&nbsp;<code class=verbatim>_</code>&nbsp;<code class=verbatim>~</code>&nbsp;</p>
</tt>
<p>
See section&nbsp;<a href="r5rs-Z-H-10.html#%_sec_7.1.1">7.1.1</a> for a formal syntax of identifiers.</p>
<p>
Identifiers have two uses within Scheme programs:
</p>
<ul>
<li>
<p>Any identifier may be used as a variable<a name="%_idx_16"></a>
or as a syntactic keyword<a name="%_idx_18"></a>
(see sections&nbsp;<a href="r5rs-Z-H-6.html#%_sec_3.1">3.1</a> and&nbsp;<a href="r5rs-Z-H-7.html#%_sec_4.3">4.3</a>).</p>
<p>
</p>
<li>
<p>When an identifier appears as a literal or within a literal
(see section&nbsp;<a href="r5rs-Z-H-7.html#%_sec_4.1.2">4.1.2</a>), it is being used to denote a <em>symbol</em>
(see section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.3.3">6.3.3</a>).</p>
<p>
</p>
</ul>
<p></p>
<p>
</p>
<p>
</p>
<a name="%_sec_2.2"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_2.2">2.2&nbsp;&nbsp;Whitespace and comments</a></h2>
<p><a name="%_idx_20"></a><em>Whitespace</em> characters are spaces and newlines.
(Implementations typically provide additional whitespace characters such
as tab or page break.) Whitespace is used for improved readability and
as necessary to separate tokens from each other, a token being an
indivisible lexical unit such as an identifier or number, but is
otherwise insignificant. Whitespace may occur between any two tokens,
but not within a token. Whitespace may also occur inside a string,
where it is significant.</p>
<p>
A semicolon (<tt>;</tt>) indicates the start of a
comment.<a name="%_idx_22"></a><a name="%_idx_24"></a> The comment continues to the
end of the line on which the semicolon appears. Comments are invisible
to Scheme, but the end of the line is visible as whitespace. This
prevents a comment from appearing in the middle of an identifier or
number.</p>
<p>
<tt>;;;&nbsp;The&nbsp;FACT&nbsp;procedure&nbsp;computes&nbsp;the&nbsp;factorial<br>
;;;&nbsp;of&nbsp;a&nbsp;non-negative&nbsp;integer.<br>
(define&nbsp;fact<br>
&nbsp;&nbsp;(lambda&nbsp;(n)<br>
&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(=&nbsp;n&nbsp;0)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;Base&nbsp;case:&nbsp;return&nbsp;1<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(*&nbsp;n&nbsp;(fact&nbsp;(-&nbsp;n&nbsp;1))))))</p>
</tt>
<p>
</p>
<a name="%_sec_2.3"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_2.3">2.3&nbsp;&nbsp;Other notations</a></h2>
<p></p>
<p>
For a description of the notations used for numbers, see
section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.2">6.2</a>.</p>
<p>
</p>
<ul>
<p>
</p>
<li>
<p><b><tt>. + -</tt></b>&nbsp;&nbsp;
These are used in numbers, and may also occur anywhere in an identifier
except as the first character. A delimited plus or minus sign by itself
is also an identifier.
A delimited period (not occurring within a number or identifier) is used
in the notation for pairs (section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.3.2">6.3.2</a>), and to indicate a
rest-parameter in a formal parameter list (section&nbsp;<a href="r5rs-Z-H-7.html#%_sec_4.1.4">4.1.4</a>).
A delimited sequence of three successive periods is also an identifier.</p>
<p>
</p>
<li>
<p><b><tt>( )</tt></b>&nbsp;&nbsp;
Parentheses are used for grouping and to notate lists
(section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.3.2">6.3.2</a>).</p>
<p>
</p>
<li>
<p><b><tt>'</tt></b>&nbsp;&nbsp;
The single quote character is used to indicate literal data (section&nbsp;<a href="r5rs-Z-H-7.html#%_sec_4.1.2">4.1.2</a>).</p>
<p>
</p>
<li>
<p><b><tt>`</tt></b>&nbsp;&nbsp;
The backquote character is used to indicate almost-constant
data (section&nbsp;<a href="r5rs-Z-H-7.html#%_sec_4.2.6">4.2.6</a>).</p>
<p>
</p>
<li>
<p><b><tt>, ,@</tt></b>&nbsp;&nbsp;
The character comma and the sequence comma at-sign are used in conjunction
with backquote (section&nbsp;<a href="r5rs-Z-H-7.html#%_sec_4.2.6">4.2.6</a>).</p>
<p>
</p>
<li>
<p><b><tt>&quot;</tt></b>&nbsp;&nbsp;
The double quote character is used to delimit strings (section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.3.5">6.3.5</a>).</p>
<p>
</p>
<li>
<p><b><tt>\</tt></b>&nbsp;&nbsp;
Backslash is used in the syntax for character constants
(section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.3.4">6.3.4</a>) and as an escape character within string
constants (section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.3.5">6.3.5</a>).</p>
<p>
</p>
<li>
<p><b><code class=verbatim>[ ] { } |</code></b>&nbsp;&nbsp;
Left and right square brackets and curly braces and vertical bar
are reserved for possible future extensions to the language.</p>
<p>
</p>
<li>
<p><b><tt>#</tt></b>&nbsp;&nbsp; Sharp sign is used for a variety of purposes depending on
the character that immediately follows it:</p>
<p>
</p>
<li>
<p><b><tt>#t</tt> <tt>#f</tt></b>&nbsp;&nbsp;
These are the boolean constants (section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.3.1">6.3.1</a>).</p>
<p>
</p>
<li>
<p><b><tt>#</tt><tt>\</tt></b>&nbsp;&nbsp;
This introduces a character constant (section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.3.4">6.3.4</a>).</p>
<p>
</p>
<li>
<p><b><tt>#</tt><tt>(</tt></b>&nbsp;&nbsp;
This introduces a vector constant (section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.3.6">6.3.6</a>). Vector constants
are terminated by&nbsp;<tt>)</tt>&nbsp;.</p>
<p>
</p>
<li>
<p><b><tt>#e #i #b #o #d #x</tt></b>&nbsp;&nbsp;
These are used in the notation for numbers (section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.2.4">6.2.4</a>).</p>
<p>
</p>
</ul>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p></p>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-4.html">previous</a></span><span>, <a href="r5rs-Z-H-6.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
</body>
</html>

View File

@ -0,0 +1,338 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="noindex,follow">
</head>
<body>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-5.html">previous</a></span><span>, <a href="r5rs-Z-H-7.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
<a name="%_chap_3"></a>
<h1 class=chapter>
<div class=chapterheading><a href="r5rs-Z-H-2.html#%_toc_%_chap_3">Chapter 3</a></div><br>
<a href="r5rs-Z-H-2.html#%_toc_%_chap_3">Basic concepts</a></h1>
<p></p>
<p>
</p>
<a name="%_sec_3.1"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_3.1">3.1&nbsp;&nbsp;Variables, syntactic keywords, and regions</a></h2>
<p>
</p>
<p>
An identifier<a name="%_idx_26"></a> may name a type of syntax, or it may name
a location where a value can be stored. An identifier that names a type
of syntax is called a <em>syntactic keyword</em><a name="%_idx_28"></a>
and is said to be <em>bound</em> to that syntax. An identifier that names a
location is called a <em>variable</em><a name="%_idx_30"></a> and is said to be
<em>bound</em> to that location. The set of all visible
bindings<a name="%_idx_32"></a> in effect at some point in a program is
known as the <em>environment</em> in effect at that point. The value
stored in the location to which a variable is bound is called the
variable's value. By abuse of terminology, the variable is sometimes
said to name the value or to be bound to the value. This is not quite
accurate, but confusion rarely results from this practice.</p>
<p>
</p>
<p>
</p>
<p>
Certain expression types are used to create new kinds of syntax
and bind syntactic keywords to those new syntaxes, while other
expression types create new locations and bind variables to those
locations. These expression types are called <em>binding constructs</em>.
<a name="%_idx_34"></a>
Those that bind syntactic keywords are listed in section&nbsp;<a href="r5rs-Z-H-7.html#%_sec_4.3">4.3</a>.
The most fundamental of the variable binding constructs is the
<tt>lambda</tt> expression, because all other variable binding constructs
can be explained in terms of <tt>lambda</tt> expressions. The other
variable binding constructs are <tt>let</tt>, <tt>let*</tt>, <tt>letrec</tt>,
and <tt>do</tt> expressions (see sections&nbsp;<a href="r5rs-Z-H-7.html#%_sec_4.1.4">4.1.4</a>, <a href="r5rs-Z-H-7.html#%_sec_4.2.2">4.2.2</a>, and
<a href="r5rs-Z-H-7.html#%_sec_4.2.4">4.2.4</a>).</p>
<p>
Like Algol and Pascal, and unlike most other dialects of Lisp
except for Common Lisp, Scheme is a statically scoped language with
block structure. To each place where an identifier is bound in a program
there corresponds a <a name="%_idx_36"></a><em>region</em> of the program text within which
the binding is visible. The region is determined by the particular
binding construct that establishes the binding; if the binding is
established by a <tt>lambda</tt> expression, for example, then its region
is the entire <tt>lambda</tt> expression. Every mention of an identifier
refers to the binding of the identifier that established the
innermost of the regions containing the use. If there is no binding of
the identifier whose region contains the use, then the use refers to the
binding for the variable in the top level environment, if any
(chapters&nbsp;<a href="r5rs-Z-H-7.html#%_chap_4">4</a> and <a href="r5rs-Z-H-9.html#%_chap_6">6</a>); if there is no
binding for the identifier,
it is said to be <a name="%_idx_38"></a><em>unbound</em>.<a name="%_idx_40"></a><a name="%_idx_42"></a></p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<a name="%_sec_3.2"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_3.2">3.2&nbsp;&nbsp;Disjointness of types</a></h2>
<p></p>
<p>
No object satisfies more than one of the following predicates:</p>
<p>
<tt>boolean?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pair?<br>
symbol?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;number?<br>
char?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string?<br>
vector?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;port?<br>
procedure?</p>
</tt>
<p>
These predicates define the types <em>boolean</em>, <em>pair</em>, <em>symbol</em>, <em>number</em>, <em>char</em> (or <em>character</em>), <em>string</em>, <em>vector</em>, <em>port</em>, and <em>procedure</em>. The empty list is a special
object of its own type; it satisfies none of the above predicates.
<a name="%_idx_44"></a><a name="%_idx_46"></a><a name="%_idx_48"></a><a name="%_idx_50"></a>
<a name="%_idx_52"></a><a name="%_idx_54"></a><a name="%_idx_56"></a><a name="%_idx_58"></a>
<a name="%_idx_60"></a><a name="%_idx_62"></a><a name="%_idx_64"></a></p>
<p>
Although there is a separate boolean type,
any Scheme value can be used as a boolean value for the purpose of a
conditional test. As explained in section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.3.1">6.3.1</a>, all
values count as true in such a test except for <tt>#f</tt>.
This report uses the word ``true'' to refer to any
Scheme value except <tt>#f</tt>, and the word ``false'' to refer to
<tt>#f</tt>. <a name="%_idx_66"></a> <a name="%_idx_68"></a></p>
<p>
</p>
<a name="%_sec_3.3"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_3.3">3.3&nbsp;&nbsp;External representations</a></h2>
<p></p>
<p>
An important concept in Scheme (and Lisp) is that of the <em>external
representation</em> of an object as a sequence of characters. For example,
an external representation of the integer 28 is the sequence of
characters ``<tt>28</tt>'', and an external representation of a list consisting
of the integers 8 and 13 is the sequence of characters ``<tt>(8 13)</tt>''.</p>
<p>
The external representation of an object is not necessarily unique. The
integer 28 also has representations ``<tt>#e28.000</tt>'' and ``<tt>#x1c</tt>'', and the
list in the previous paragraph also has the representations ``<tt>( 08 13
)</tt>'' and ``<tt>(8 . (13 . ()))</tt>'' (see section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.3.2">6.3.2</a>).</p>
<p>
Many objects have standard external representations, but some, such as
procedures, do not have standard representations (although particular
implementations may define representations for them).</p>
<p>
An external representation may be written in a program to obtain the
corresponding object (see <tt>quote</tt>, section&nbsp;<a href="r5rs-Z-H-7.html#%_sec_4.1.2">4.1.2</a>).</p>
<p>
External representations can also be used for input and output. The
procedure <tt>read</tt> (section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.6.2">6.6.2</a>) parses external
representations, and the procedure <tt>write</tt> (section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.6.3">6.6.3</a>)
generates them. Together, they provide an elegant and powerful
input/output facility.</p>
<p>
Note that the sequence of characters ``<tt>(+ 2 6)</tt>'' is <em>not</em> an
external representation of the integer 8, even though it <em>is</em> an
expression evaluating to the integer 8; rather, it is an external
representation of a three-element list, the elements of which are the symbol
<tt>+</tt> and the integers 2 and 6. Scheme's syntax has the property that
any sequence of characters that is an expression is also the external
representation of some object. This can lead to confusion, since it may
not be obvious out of context whether a given sequence of characters is
intended to denote data or program, but it is also a source of power,
since it facilitates writing programs such as interpreters and
compilers that treat programs as data (or vice versa).</p>
<p>
The syntax of external representations of various kinds of objects
accompanies the description of the primitives for manipulating the
objects in the appropriate sections of chapter&nbsp;<a href="r5rs-Z-H-9.html#%_chap_6">6</a>.</p>
<p>
</p>
<a name="%_sec_3.4"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_3.4">3.4&nbsp;&nbsp;Storage model</a></h2>
<p></p>
<p>
Variables and objects such as pairs, vectors, and strings implicitly
denote locations<a name="%_idx_70"></a> or sequences of locations. A string, for
example, denotes as many locations as there are characters in the string.
(These locations need not correspond to a full machine word.) A new value may be
stored into one of these locations using the <tt>string-set!</tt> procedure, but
the string continues to denote the same locations as before.</p>
<p>
An object fetched from a location, by a variable reference or by
a procedure such as <tt>car</tt>, <tt>vector-ref</tt>, or <tt>string-ref</tt>, is
equivalent in the sense of <tt>eqv?</tt> (section&nbsp;<a href="r5rs-Z-H-9.html#%_sec_6.1">6.1</a>)
to the object last stored in the location before the fetch.</p>
<p>
Every location is marked to show whether it is in use.
No variable or object ever refers to a location that is not in use.
Whenever this report speaks of storage being allocated for a variable
or object, what is meant is that an appropriate number of locations are
chosen from the set of locations that are not in use, and the chosen
locations are marked to indicate that they are now in use before the variable
or object is made to denote them.</p>
<p>
In many systems it is desirable for constants<a name="%_idx_72"></a> (i.e. the values of
literal expressions) to reside in read-only-memory. To express this, it is
convenient to imagine that every object that denotes locations is associated
with a flag telling whether that object is mutable<a name="%_idx_74"></a> or
immutable<a name="%_idx_76"></a>. In such systems literal constants and the strings
returned by <tt>symbol-&gt;string</tt> are immutable objects, while all objects
created by the other procedures listed in this report are mutable. It is an
error to attempt to store a new value into a location that is denoted by an
immutable object.</p>
<p>
</p>
<a name="%_sec_3.5"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_3.5">3.5&nbsp;&nbsp;Proper tail recursion</a></h2>
<p></p>
<p>
Implementations of Scheme are required to be
<em>properly tail-recursive</em><a name="%_idx_78"></a>.
Procedure calls that occur in certain syntactic
contexts defined below are `tail calls'. A Scheme implementation is
properly tail-recursive if it supports an unbounded number of active
tail calls. A call is <em>active</em> if the called procedure may still
return. Note that this includes calls that may be returned from either
by the current continuation or by continuations captured earlier by
<tt>call-with-current-continuation</tt> that are later invoked.
In the absence of captured continuations, calls could
return at most once and the active calls would be those that had not
yet returned.
A formal definition of proper tail recursion can be found
in&nbsp;[<a href="r5rs-Z-H-14.html#cite{propertailrecursion}">8</a>].</p>
<p>
</p>
<blockquote><em>Rationale:&nbsp;&nbsp;</em>
<p>
Intuitively, no space is needed for an active tail call because the
continuation that is used in the tail call has the same semantics as the
continuation passed to the procedure containing the call. Although an improper
implementation might use a new continuation in the call, a return
to this new continuation would be followed immediately by a return
to the continuation passed to the procedure. A properly tail-recursive
implementation returns to that continuation directly.</p>
<p>
Proper tail recursion was one of the central ideas in Steele and
Sussman's original version of Scheme. Their first Scheme interpreter
implemented both functions and actors. Control flow was expressed using
actors, which differed from functions in that they passed their results
on to another actor instead of returning to a caller. In the terminology
of this section, each actor finished with a tail call to another actor.</p>
<p>
Steele and Sussman later observed that in their interpreter the code
for dealing with actors was identical to that for functions and thus
there was no need to include both in the language.</p>
<p>
</p>
</blockquote>
<p>
A <em>tail call</em><a name="%_idx_80"></a> is a procedure call that occurs
in a <em>tail context</em>. Tail contexts are defined inductively. Note
that a tail context is always determined with respect to a particular lambda
expression.</p>
<p>
</p>
<ul>
<li>
<p>The last expression within the body of a lambda expression,
shown as &lt;tail expression&gt; below, occurs in a tail context.
<tt>(lambda&nbsp;&lt;formals&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;definition&gt;*&nbsp;&lt;expression&gt;*&nbsp;&lt;tail&nbsp;expression&gt;)<br>
</p>
</tt>
<li>
<p>If one of the following expressions is in a tail context,
then the subexpressions shown as &lt;tail expression&gt; are in a tail context.
These were derived from rules in the grammar given in
chapter&nbsp;<a href="r5rs-Z-H-10.html#%_chap_7">7</a> by replacing some occurrences of &lt;expression&gt;
with &lt;tail expression&gt;. Only those rules that contain tail contexts
are shown here.</p>
<p>
<tt>(if&nbsp;&lt;expression&gt;&nbsp;&lt;tail&nbsp;expression&gt;&nbsp;&lt;tail&nbsp;expression&gt;)<br>
(if&nbsp;&lt;expression&gt;&nbsp;&lt;tail&nbsp;expression&gt;)<br>
<br>
(cond&nbsp;&lt;cond&nbsp;clause&gt;<sup>+</sup>)<br>
(cond&nbsp;&lt;cond&nbsp;clause&gt;*&nbsp;(else&nbsp;&lt;tail&nbsp;sequence&gt;))<br>
<br>
(case&nbsp;&lt;expression&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;case&nbsp;clause&gt;<sup>+</sup>)<br>
(case&nbsp;&lt;expression&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;case&nbsp;clause&gt;*<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(else&nbsp;&lt;tail&nbsp;sequence&gt;))<br>
<br>
(and&nbsp;&lt;expression&gt;*&nbsp;&lt;tail&nbsp;expression&gt;)<br>
(or&nbsp;&lt;expression&gt;*&nbsp;&lt;tail&nbsp;expression&gt;)<br>
<br>
(let&nbsp;(&lt;binding&nbsp;spec&gt;*)&nbsp;&lt;tail&nbsp;body&gt;)<br>
(let&nbsp;&lt;variable&gt;&nbsp;(&lt;binding&nbsp;spec&gt;*)&nbsp;&lt;tail&nbsp;body&gt;)<br>
(let*&nbsp;(&lt;binding&nbsp;spec&gt;*)&nbsp;&lt;tail&nbsp;body&gt;)<br>
(letrec&nbsp;(&lt;binding&nbsp;spec&gt;*)&nbsp;&lt;tail&nbsp;body&gt;)<br>
<br>
(let-syntax&nbsp;(&lt;syntax&nbsp;spec&gt;*)&nbsp;&lt;tail&nbsp;body&gt;)<br>
(letrec-syntax&nbsp;(&lt;syntax&nbsp;spec&gt;*)&nbsp;&lt;tail&nbsp;body&gt;)<br>
<br>
(begin&nbsp;&lt;tail&nbsp;sequence&gt;)<br>
<br>
(do&nbsp;(&lt;iteration&nbsp;spec&gt;*)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&lt;test&gt;&nbsp;&lt;tail&nbsp;sequence&gt;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;expression&gt;*)<br>
<br>
where<br>
<br>
&lt;cond&nbsp;clause&gt;&nbsp;---&gt;&nbsp;(&lt;test&gt;&nbsp;&lt;tail&nbsp;sequence&gt;)<br>
&lt;case&nbsp;clause&gt;&nbsp;---&gt;&nbsp;((&lt;datum&gt;*)&nbsp;&lt;tail&nbsp;sequence&gt;)<br>
<br>
&lt;tail&nbsp;body&gt;&nbsp;---&gt;&nbsp;&lt;definition&gt;*&nbsp;&lt;tail&nbsp;sequence&gt;<br>
&lt;tail&nbsp;sequence&gt;&nbsp;---&gt;&nbsp;&lt;expression&gt;*&nbsp;&lt;tail&nbsp;expression&gt;<br>
</p>
</tt>
<li>
<p>If a <tt>cond</tt> expression is in a tail context, and has a clause of
the form <tt>(&lt;expression<sub>1</sub>&gt; =&gt; &lt;expression<sub>2</sub>&gt;)</tt>
then the (implied) call to
the procedure that results from the evaluation of &lt;expression<sub>2</sub>&gt; is in a
tail context. &lt;expression<sub>2</sub>&gt; itself is not in a tail context.</p>
<p>
</p>
</ul>
<p></p>
<p>
Certain built-in procedures are also required to perform tail calls.
The first argument passed to <tt>apply</tt> and to
<tt>call-with-current-continuation</tt>, and the second argument passed to
<tt>call-with-values</tt>, must be called via a tail call.
Similarly, <tt>eval</tt> must evaluate its argument as if it
were in tail position within the <tt>eval</tt> procedure.</p>
<p>
In the following example the only tail call is the call to <tt>f</tt>.
None of the calls to <tt>g</tt> or <tt>h</tt> are tail calls. The reference to
<tt>x</tt> is in a tail context, but it is not a call and thus is not a
tail call.
<tt>(lambda&nbsp;()<br>
&nbsp;&nbsp;(if&nbsp;(g)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;((x&nbsp;(h)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(and&nbsp;(g)&nbsp;(f))))<br>
</p>
</tt>
<blockquote><em>Note:&nbsp;&nbsp;</em>
Implementations are allowed, but not required, to
recognize that some non-tail calls, such as the call to <tt>h</tt>
above, can be evaluated as though they were tail calls.
In the example above, the <tt>let</tt> expression could be compiled
as a tail call to <tt>h</tt>. (The possibility of <tt>h</tt> returning
an unexpected number of values can be ignored, because in that
case the effect of the <tt>let</tt> is explicitly unspecified and
implementation-dependent.)
</blockquote>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p></p>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-5.html">previous</a></span><span>, <a href="r5rs-Z-H-7.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
</body>
</html>

1201
doc/r5rs-std/r5rs-Z-H-7.html Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,213 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="noindex,follow">
</head>
<body>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-7.html">previous</a></span><span>, <a href="r5rs-Z-H-9.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
<a name="%_chap_5"></a>
<h1 class=chapter>
<div class=chapterheading><a href="r5rs-Z-H-2.html#%_toc_%_chap_5">Chapter 5</a></div><br>
<a href="r5rs-Z-H-2.html#%_toc_%_chap_5">Program structure</a></h1>
<p></p>
<p>
</p>
<a name="%_sec_5.1"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_5.1">5.1&nbsp;&nbsp;Programs</a></h2>
<p>A Scheme program consists of a sequence of expressions, definitions,
and syntax definitions.
Expressions are described in chapter&nbsp;<a href="r5rs-Z-H-7.html#%_chap_4">4</a>;
definitions and syntax definitions are the subject of the rest of the
present chapter.</p>
<p>
Programs are typically stored in files or entered interactively to a
running Scheme system, although other paradigms are possible;
questions of user interface lie outside the scope of this report.
(Indeed, Scheme would still be useful as a notation for expressing
computational methods even in the absence of a mechanical
implementation.)</p>
<p>
Definitions and syntax definitions occurring at the top level of a program
can be interpreted
declaratively.
They cause bindings to be created in the top level
environment or modify the value of existing top-level bindings.
Expressions occurring at the top level of a program are
interpreted imperatively; they are executed in order when the program is
invoked or loaded, and typically perform some kind of initialization.</p>
<p>
At the top level of a program <tt>(begin &lt;form<sub>1</sub>&gt; <tt>...</tt>)</tt> is
equivalent to the sequence of expressions, definitions, and syntax definitions
that form the body of the <tt>begin</tt>.</p>
<p>
</p>
<p>
</p>
<a name="%_sec_5.2"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_5.2">5.2&nbsp;&nbsp;Definitions</a></h2>
<p></p>
<p>
Definitions are valid in some, but not all, contexts where expressions
are allowed. They are valid only at the top level of a &lt;program&gt;
and at the beginning of a &lt;body&gt;.
<a name="%_idx_192"></a></p>
<p>
A definition should have one of the following forms:<a name="%_idx_194"></a></p>
<p>
</p>
<ul>
<p>
</p>
<li>
<p><tt>(define &lt;variable&gt; &lt;expression&gt;)</tt></p>
<p>
</p>
<li>
<p><tt>(define (&lt;variable&gt; &lt;formals&gt;) &lt;body&gt;)</tt></p>
<p>
&lt;Formals&gt; should be either a
sequence of zero or more variables, or a sequence of one or more
variables followed by a space-delimited period and another variable (as
in a lambda expression). This form is equivalent to
<tt>(define&nbsp;&lt;variable&gt;<br>
&nbsp;&nbsp;(lambda&nbsp;(&lt;formals&gt;)&nbsp;&lt;body&gt;)).</p>
</tt>
<p>
</p>
<li>
<p><tt>(define (&lt;variable&gt; . &lt;formal&gt;) &lt;body&gt;)</tt></p>
<p>
&lt;Formal&gt; should be a single
variable. This form is equivalent to
<tt>(define&nbsp;&lt;variable&gt;<br>
&nbsp;&nbsp;(lambda&nbsp;&lt;formal&gt;&nbsp;&lt;body&gt;)).</p>
</tt>
<p>
</p>
</ul>
<p></p>
<p>
</p>
<a name="%_sec_5.2.1"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_5.2.1">5.2.1&nbsp;&nbsp;Top level definitions</a></h3>
<p>At the top level of a program, a definition
<tt>(define&nbsp;&lt;variable&gt;&nbsp;&lt;expression&gt;)</p>
</tt>
has essentially the same effect as the assignment expression
<tt>(<tt>set!</tt> &lt;variable&gt;&nbsp;&lt;expression&gt;)</tt>
if &lt;variable&gt; is bound. If &lt;variable&gt; is not bound,
however, then the definition will bind &lt;variable&gt; to a new
location before performing the assignment, whereas it would be an error
to perform a <tt>set!</tt> on an unbound<a name="%_idx_196"></a> variable.
<p>
<tt>(define&nbsp;add3<br>
&nbsp;&nbsp;(lambda&nbsp;(x)&nbsp;(+&nbsp;x&nbsp;3)))<br>
(add3&nbsp;3)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;===&gt;&nbsp;&nbsp;6<br>
(define&nbsp;first&nbsp;car)<br>
(first&nbsp;'(1&nbsp;2))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;===&gt;&nbsp;&nbsp;1</p>
</tt>
<p>
Some implementations of Scheme use an initial environment in
which all possible variables are bound to locations, most of
which contain undefined values. Top level definitions in
such an implementation are truly equivalent to assignments.</p>
<p>
</p>
<p>
</p>
<a name="%_sec_5.2.2"></a>
<h3><a href="r5rs-Z-H-2.html#%_toc_%_sec_5.2.2">5.2.2&nbsp;&nbsp;Internal definitions</a></h3>
<p></p>
<p>
Definitions may occur at the
beginning of a &lt;body&gt; (that is, the body of a <tt>lambda</tt>,
<tt>let</tt>, <tt>let*</tt>, <tt>letrec</tt>, <tt>let-syntax</tt>, or <tt>letrec-syntax</tt>
expression or that of a definition of an appropriate form).
Such definitions are known as <em>internal definitions</em> <a name="%_idx_198"></a> as opposed to the top level definitions described above.
The variable defined by an internal definition is local to the
&lt;body&gt;. That is, &lt;variable&gt; is bound rather than assigned,
and the region of the binding is the entire &lt;body&gt;. For example,</p>
<p>
<tt>(let&nbsp;((x&nbsp;5))<br>
&nbsp;&nbsp;(define&nbsp;foo&nbsp;(lambda&nbsp;(y)&nbsp;(bar&nbsp;x&nbsp;y)))<br>
&nbsp;&nbsp;(define&nbsp;bar&nbsp;(lambda&nbsp;(a&nbsp;b)&nbsp;(+&nbsp;(*&nbsp;a&nbsp;b)&nbsp;a)))<br>
&nbsp;&nbsp;(foo&nbsp;(+&nbsp;x&nbsp;3)))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;===&gt;&nbsp;&nbsp;45</p>
</tt>
<p>
A &lt;body&gt; containing internal definitions can always be converted
into a completely equivalent <tt>letrec</tt> expression. For example, the
<tt>let</tt> expression in the above example is equivalent to</p>
<p>
<tt>(let&nbsp;((x&nbsp;5))<br>
&nbsp;&nbsp;(letrec&nbsp;((foo&nbsp;(lambda&nbsp;(y)&nbsp;(bar&nbsp;x&nbsp;y)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(bar&nbsp;(lambda&nbsp;(a&nbsp;b)&nbsp;(+&nbsp;(*&nbsp;a&nbsp;b)&nbsp;a))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;(foo&nbsp;(+&nbsp;x&nbsp;3))))</p>
</tt>
<p>
Just as for the equivalent <tt>letrec</tt> expression, it must be
possible to evaluate each &lt;expression&gt; of every internal
definition in a &lt;body&gt; without assigning or referring to
the value of any &lt;variable&gt; being defined.</p>
<p>
Wherever an internal definition may occur
<tt>(begin &lt;definition<sub>1</sub>&gt; <tt>...</tt>)</tt>
is equivalent to the sequence of definitions
that form the body of the <tt>begin</tt>.</p>
<p>
</p>
<a name="%_sec_5.3"></a>
<h2><a href="r5rs-Z-H-2.html#%_toc_%_sec_5.3">5.3&nbsp;&nbsp;Syntax definitions</a></h2>
<p>Syntax definitions are valid only at the top level of a &lt;program&gt;.
<a name="%_idx_200"></a>
They have the following form:<a name="%_idx_202"></a></p>
<p>
<tt>(define-syntax &lt;keyword&gt; &lt;transformer spec&gt;)</tt></p>
<p>
&lt;Keyword&gt; is an identifier, and
the &lt;transformer spec&gt; should be an instance of <tt>syntax-rules</tt>.
The top-level syntactic environment is extended by binding the
&lt;keyword&gt; to the specified transformer.</p>
<p>
There is no <tt>define-syntax</tt> analogue of internal definitions.</p>
<p>
Although macros may expand into definitions and syntax definitions in
any context that permits them, it is an error for a definition or syntax
definition to shadow a syntactic keyword whose meaning is needed to
determine whether some form in the group of forms that contains the
shadowing definition is in fact a definition, or, for internal definitions,
is needed to determine the boundary between the group and the expressions
that follow the group. For example, the following are errors:</p>
<p>
<tt>(define&nbsp;define&nbsp;3)<br>
<br>
(begin&nbsp;(define&nbsp;begin&nbsp;list))<br>
<br>
(let-syntax<br>
&nbsp;&nbsp;((foo&nbsp;(syntax-rules&nbsp;()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((foo&nbsp;(proc&nbsp;args&nbsp;...)&nbsp;body&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(define&nbsp;proc<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(lambda&nbsp;(args&nbsp;...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;body&nbsp;...))))))<br>
&nbsp;&nbsp;(let&nbsp;((x&nbsp;3))<br>
&nbsp;&nbsp;&nbsp;&nbsp;(foo&nbsp;(plus&nbsp;x&nbsp;y)&nbsp;(+&nbsp;x&nbsp;y))<br>
&nbsp;&nbsp;&nbsp;&nbsp;(define&nbsp;foo&nbsp;x)<br>
&nbsp;&nbsp;&nbsp;&nbsp;(plus&nbsp;foo&nbsp;x)))<br>
</p>
</tt>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>
</p>
<div class=navigation>[Go to <span><a href="r5rs.html">first</a>, <a href="r5rs-Z-H-7.html">previous</a></span><span>, <a href="r5rs-Z-H-9.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
</body>
</html>

3484
doc/r5rs-std/r5rs-Z-H-9.html Normal file

File diff suppressed because it is too large Load Diff

343
doc/r5rs-std/r5rs.html Normal file
View File

@ -0,0 +1,343 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Generated from TeX source by tex2page, v 4p4,
(c) Dorai Sitaram, http://www.cs.rice.edu/~dorai/tex2page -->
<head>
<title>
Revised^5 Report on the Algorithmic Language Scheme
</title>
<link rel="stylesheet" type="text/css" href="r5rs-Z-C.css" title=default>
<meta name=robots content="index,follow">
</head>
<body>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<div align=center>
<h1><br><br>Revised<sup>5</sup> Report on the Algorithmic Language Scheme</h1>
<p>
20 February 1998<br>
<br>
Richard Kelsey, William Clinger, and Jonathan Rees (<i>Editors</i>)<br>
&nbsp;<br>
<table width=100%>
<tr><td>H. Abelson </td><td> R. K. Dybvig </td><td> C. T. Haynes </td><td> G. J. Rozas</td></tr>
<tr><td>N. I. Adams IV </td><td> D. P. Friedman </td><td> E. Kohlbecker </td><td> G. L. Steele Jr.</td></tr>
<tr><td>D. H. Bartley </td><td> R. Halstead </td><td> D. Oxley </td><td> G. J. Sussman</td></tr>
<tr><td>G. Brooks </td><td> C. Hanson </td><td> K. M. Pitman </td><td> M. Wand</td></tr>
</table><br>
<em>Dedicated to the Memory of Robert Hieb</em>
</p>
<p></div>
</p>
<p></p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<div class=navigation>[Go to <span class=disable>first, previous</span><span><span class=disable>, </span><a href="r5rs-Z-H-1.html">next</a></span> page<span>; &nbsp;&nbsp;</span><span><a href="r5rs-Z-H-2.html#%_toc_start">contents</a></span><span><span>; &nbsp;&nbsp;</span><a href="r5rs-Z-H-15.html#%_index_start">index</a></span>]</div>
<p></p>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More