commit 901dd89f4d3b8ca8f8e3367f61428b1091bb6273
parent 6a2955d2a38198300ba44885254be89d8c856dab
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date: Tue, 6 Feb 2024 23:11:24 -0500
Language changes: Texify.
Diffstat:
1 file changed, 374 insertions(+), 244 deletions(-)
diff --git a/doc/r7rs-small/language-changes.texinfo b/doc/r7rs-small/language-changes.texinfo
@@ -8,272 +8,402 @@
@end menu
@node Incompatibilities with R5RS
-@section Incompatibilities with R5RS
+@section Incompatibilities with @rfivers{}
-This section enumerates the incompatibilities between this report and the ``Revised5
+This section enumerates the incompatibilities between this report and the ``Revised@sup{5}
report'' [20].
This list is not authoritative, but is believed to be correct and complete.
-* Case sensitivity is now the default in symbols and character names. This means that
- code written under the assumption that symbols could be written FOO or Foo in some
- contexts and foo in other contexts can either be changed, be marked with the new
- #!fold-case directive, or be included in a library using the include-ci library declaration.
- All standard identifiers are entirely in lower case.
+@itemize @bullet
-* The syntax-rules construct now recognizes _ (underscore) as a wildcard, which means it
- cannot be used as a syntax variable. It can still be used as a literal.
+@item
+Case sensitivity is now the default in symbols and character names.
+This means that code written under the assumption that symbols could be
+written @code{FOO} or @code{Foo} in some contexts and @code{foo} in other contexts
+can either be changed, be marked with the new @code{#!fold-case} directive,
+or be included in a library using the @code{include-ci} library declaration.
+All standard identifiers are entirely in lower case.
-* The R5RS procedures exact->inexact and inexact->exact have been renamed to their
- R6RS names, inexact and exact, respectively, as these names are shorter and more
- correct. The former names are still available in the R5RS library.
+@item
+The @code{syntax-rules} construct now recognizes @code{_} (underscore)
+as a wildcard, which means it cannot be used as a syntax variable.
+It can still be used as a literal.
-* The guarantee that string comparison (with string<? and the related predicates) is a
- lexicographical extension of character comparison (with char<? and the related
- predicates) has been removed.
+@item
+The @rfivers{} procedures @code{exact->inexact} and @code{inexact->exact}
+have been renamed to their @rsixrs{} names, @code{inexact} and @code{exact},
+respectively, as these names are shorter and more correct.
+The former names are still available in the @rfivers{} library.
-* Support for the # character in numeric literals is no longer required.
+@item
+The guarantee that string comparison (with @code{string<?} and the
+related predicates) is a lexicographical extension of character comparison
+(with @code{char<?} and the related predicates) has been removed.
-* Support for the letters s, f, d, and l as exponent markers is no longer required.
+@item
+Support for the # character in numeric literals is no longer required.
-* Implementations of string->number are no longer permitted to return #f when the
- argument contains an explicit radix prefix, and must be compatible with read and the
- syntax of numbers in programs.
+@item
+Support for the letters @code{s}, @code{f}, @code{d}, and @code{l}
+as exponent markers is no longer required.
-* The procedures transcript-on and transcript-off have been removed.
+@item
+Implementations of @code{string->number} are no longer permitted
+to return @code{#f} when the argument contains an explicit radix prefix,
+and must be compatible with @code{read} and the syntax of numbers in programs.
+
+@item
+The procedures @code{transcript-on} and @code{transcript-off} have been removed.
+
+@end itemize
@node Other language changes since R5RS
-@section Other language changes since R5RS
+@section Other language changes since @rfivers{}
This section enumerates the additional differences between this report and the ``Revised5
report'' [20].
This list is not authoritative, but is believed to be correct and complete.
-* Various minor ambiguities and unclarities in R5RS have been cleaned up.
-
-* Libraries have been added as a new program structure to improve encapsulation and
- sharing of code. Some existing and new identifiers have been factored out into
- separate libraries. Libraries can be imported into other libraries or main programs, with
- controlled exposure and renaming of identifiers. The contents of a library can be made
- conditional on the features of the implementation on which it is to be used. There is an
- R5RS compatibility library.
-
-* The expressions types include, include-ci, and cond-expand have been added to the
- base library; they have the same semantics as the corresponding library declarations.
-
-* Exceptions can now be signaled explicitly with raise, raise-continuable or error, and can
- be handled with with-exception-handler and the guard syntax. Any object can specify an
- error condition; the implementation-defined conditions signaled by error have a
- predicate to detect them and accessor functions to retrieve the arguments passed to
- error. Conditions signaled by read and by file-related procedures also have predicates
- to detect them.
-
-* New disjoint types supporting access to multiple fields can be generated with the
- define-record-type of SRFI 9 [19]
-
-* Parameter objects can be created with make-parameter, and dynamically rebound with
- parameterize. The procedures current-input-port and current-output-port are now
- parameter objects, as is the newly introduced current-error-port.
-
-* Support for promises has been enhanced based on SRFI 45 [38].
-
-* Bytevectors, vectors of exact integers in the range from 0 to 255 inclusive, have been
- added as a new disjoint type. A subset of the vector procedures is provided.
- Bytevectors can be converted to and from strings in accordance with the UTF-8
- character encoding. Bytevectors have a datum representation and evaluate to
- themselves.
-
-* Vector constants evaluate to themselves.
-
-* The procedure read-line is provided to make line-oriented textual input simpler.
-
-* The procedure flush-output-port is provided to allow minimal control of output port
- buffering.
-
-* Ports can now be designated as textual or binary ports, with new procedures for reading
- and writing binary data. The new predicates input-port-open? and output-port-open?
- return whether a port is open or closed. The new procedure close-port now closes a
- port; if the port has both input and output sides, both are closed.
-
-* String ports have been added as a way to read and write characters to and from strings,
- and bytevector ports to read and write bytes to and from bytevectors.
-
-* There are now I/O procedures specific to strings and bytevectors.
-
-* The write procedure now generates datum labels when applied to circular objects. The
- new procedure write-simple never generates labels; write-shared generates labels for
- all shared and circular structure. The display procedure must not loop on circular
- objects.
-
-* The R6RS procedure eof-object has been added. Eof-objects are now required to be a
- disjoint type.
-
-* Syntax definitions are now allowed wherever variable definitions are.
-
-* The syntax-rules construct now allows the ellipsis symbol to be specified explicitly
- instead of the default ..., allows template escapes with an ellipsis-prefixed list, and
- allows tail patterns to follow an ellipsis pattern.
-
-* The syntax-error syntax has been added as a way to signal immediate and more
- informative errors when a macro is expanded.
-
-* The letrec* binding construct has been added, and internal define is specified in terms
- of it.
-
-* Support for capturing multiple values has been enhanced with define-values,
- let-values, and let*-values. Standard expression types which contain a sequence of
- expressions now permit passing zero or more than one value to the continuations of
- all non-final expressions of the sequence.
-
-* The case conditional now supports => syntax analogous to cond not only in regular
- clauses but in the else clause as well.
-
-* To support dispatching on the number of arguments passed to a procedure,
- case-lambda has been added in its own library.
-
-* The convenience conditionals when and unless have been added.
-
-* The behavior of eqv? on inexact numbers now conforms to the R6RS definition.
-
-* When applied to procedures, eq? and eqv? are permitted to return different answers.
-
-* The R6RS procedures boolean=? and symbol=? have been added.
-
-* Positive infinity, negative infinity, NaN, and negative inexact zero have been added to
- the numeric tower as inexact values with the written representations +inf.0, -inf.0,
- +nan.0, and -0.0 respectively. Support for them is not required. The representation -
- nan.0 is synonymous with +nan.0.
-
-* The log procedure now accepts a second argument specifying the logarithm base.
-
-* The procedures map and for-each are now required to terminate on the shortest
- argument list.
-
-* The procedures member and assoc now take an optional third argument specifying the
- equality predicate to be used.
-
-* The numeric procedures finite?, infinite?, nan?, exact-integer?, square, and
- exact-integer-sqrt have been added.
-
-* The - and / procedures and the character and string comparison predicates are now
- required to support more than two arguments.
-
-* The forms #true and #false are now supported as well as #t and #f.
-
-* The procedures make-list, list-copy, list-set!, string-map, string-for-each, string->vector,
- vector-append, vector-copy, vector-map, vector-for-each, vector->string, vector-copy!,
- and string-copy! have been added to round out the sequence operations.
-
-* Some string and vector procedures support processing of part of a string or vector
- using optional
-
- start and
-
- end arguments.
-
-* Some list procedures are now defined on circular lists.
-
-* Implementations may provide any subset of the full Unicode repertoire that includes
- ASCII, but implementations must support any such subset in a way consistent with
- Unicode. Various character and string procedures have been extended accordingly, and
- case conversion procedures added for strings. String comparison is no longer required
- to be consistent with character comparison, which is based solely on Unicode scalar
- values. The new digit-value procedure has been added to obtain the numerical value of
- a numeric character.
-
-* There are now two additional comment syntaxes: #; to skip the next datum, and #| ... |#
- for nestable block comments.
-
-* Data prefixed with datum labels #@svar{n}= can be referenced with #@svar{n}#, allowing for
- reading and writing of data with shared structure.
-
-* Strings and symbols now allow mnemonic and numeric escape sequences, and the list
- of named characters has been extended.
-
-* The procedures file-exists? and delete-file are available in the (scheme file) library.
-
-* An interface to the system environment, command line, and process exit status is
- available in the (scheme process-context) library.
-
-* Procedures for accessing time-related values are available in the (scheme time) library.
-
-* A less irregular set of integer division operators is provided with new and clearer
- names.
-
-* The load procedure now accepts a second argument specifying the environment to
- load into.
-
-* The call-with-current-continuation procedure now has the synonym call/cc.
-
-* The semantics of read-eval-print loops are now partly prescribed, requiring the
- redefinition of procedures, but not syntax keywords, to have retroactive effect.
-
-* The formal semantics now handles dynamic-wind.
+@itemize @bullet
+
+@item
+Various minor ambiguities and unclarities in @rfivers{} have been cleaned up.
+
+@item
+Libraries have been added as a new program structure to improve
+encapsulation and sharing of code. Some existing and new identifiers
+have been factored out into separate libraries.
+Libraries can be imported into other libraries or main programs, with
+controlled exposure and renaming of identifiers.
+The contents of a library can be made conditional on the features of
+the implementation on which it is to be used.
+There is an @rfivers{} compatibility library.
+
+@item
+The expressions types @code{include}, @code{include-ci}, and @code{cond-expand}
+have been added to the base library; they have the same semantics as the
+corresponding library declarations.
+
+@item
+Exceptions can now be signaled explicitly with @code{raise},
+@code{raise-continuable} or @code{error}, and can be handled with
+@code{with-exception-handler} and the @code{guard} syntax.
+Any object can specify an error condition; the implementation-defined
+conditions signaled by @code{error} have a predicate to detect them and accessor functions to
+retrieve the arguments passed to @code{error}.
+Conditions signaled by @code{read} and by file-related procedures
+also have predicates to detect them.
+
+@item
+New disjoint types supporting access to multiple fields can be
+generated with the @code{define-record-type} of SRFI 9.
+@c cite SRFI 9
+
+@item
+Parameter objects can be created with @code{make-parameter}, and
+dynamically rebound with @code{parameterize}.
+The procedures @code{current-input-port} and @code{current-output-port} are now
+parameter objects, as is the newly introduced @code{current-error-port}.
+
+@item
+Support for promises has been enhanced based on SRFI 45.
+@c cite{srfi45}.
+
+@item
+Bytevectors, vectors of exact integers in the range
+from 0 to 255 inclusive, have been added as a new disjoint type.
+A subset of the vector procedures is provided. Bytevectors
+can be converted to and from strings in accordance with the UTF-8 character encoding.
+Bytevectors have a datum representation and evaluate to themselves.
+
+@item
+Vector constants evaluate to themselves.
+
+@item
+The procedure @code{read-line} is provided to make line-oriented textual input
+simpler.
+
+@item
+The procedure @code{flush-output-port} is provided to allow minimal
+control of output port buffering.
+
+@item
+Ports can now be designated as textual or
+binary ports, with new procedures for reading and writing binary
+data.
+The new predicates @code{input-port-open?} and @code{output-port-open?} return whether a port is open or closed.
+The new procedure @code{close-port} now closes a port; if the port
+has both input and output sides, both are closed.
+
+@item
+String ports have been added as a way to read and write
+characters to and from strings, and bytevector ports to read
+and write bytes to and from bytevectors.
+
+@item
+There are now I/O procedures specific to strings and bytevectors.
+
+@item
+The @code{write} procedure now generates datum labels when applied to
+circular objects. The new procedure @code{write-simple} never generates
+labels; @code{write-shared} generates labels for all shared and circular
+structure.
+The @code{display} procedure must not loop on circular objects.
+
+@item
+The @rsixrs{} procedure @code{eof-object} has been added.
+Eof-objects are now required to be a disjoint type.
+
+@item
+Syntax definitions are now allowed wherever variable definitions are.
+
+@item
+The @code{syntax-rules} construct now allows
+the ellipsis symbol to be specified explicitly instead of the default
+@code{@dots{}}, allows template escapes with an ellipsis-prefixed list, and
+allows tail patterns to follow an ellipsis pattern.
+
+@item
+The @code{syntax-error} syntax has been added as a way to signal immediate
+and more informative errors when a macro is expanded.
+
+@item
+The @code{letrec*} binding construct has been added, and internal @code{define}
+is specified in terms of it.
+
+@item
+Support for capturing multiple values has been enhanced with
+@code{define-values}, @code{let-values}, and @code{let*-values}.
+Standard expression types which contain a sequence of expressions now
+permit passing zero or more than one value to the continuations of all
+non-final expressions of the sequence.
+
+@item
+The @code{case} conditional now supports @code{=>} syntax
+analogous to @code{cond} not only in regular clauses but in the
+@code{else} clause as well.
+
+@item
+To support dispatching on the number of arguments passed to a
+procedure, @code{case-lambda} has been added in its own library.
+
+@item
+The convenience conditionals @code{when} and @code{unless} have been added.
+
+@item
+The behavior of @code{eqv?} on inexact numbers now conforms to the
+@rsixrs{} definition.
+
+@item
+When applied to procedures, @code{eq?} and @code{eqv?} are permitted to
+return different answers.
+
+@item
+The @rsixrs{} procedures @code{boolean=?} and @code{symbol=?} have been added.
+
+@item
+Positive infinity, negative infinity, NaN, and negative inexact zero have been added
+to the numeric tower as inexact values with the written
+representations @code{+inf.0}, @code{-inf.0}, @code{+nan.0}, and @code{-0.0}
+respectively. Support for them is not required.
+The representation @code{-nan.0} is synonymous with @code{+nan.0}.
+
+@item
+The @code{log} procedure now accepts a second argument specifying
+the logarithm base.
+
+@item
+The procedures @code{map} and @code{for-each} are now required to terminate on
+the shortest argument list.
+
+@item
+The procedures @code{member} and @code{assoc} now take an optional third argument
+specifying the equality predicate to be used.
+
+@item
+The numeric procedures @code{finite?}, @code{infinite?}, @code{nan?},
+@code{exact-integer?}, @code{square}, and @code{exact-integer-sqrt}
+have been added.
+
+@item
+The @code{-} and @code{/} procedures
+and the character and string comparison
+predicates are now required to support more than two arguments.
+
+@item
+The forms @code{#true} and @code{#false} are now supported
+as well as @code{#t} and @code{#f}.
+
+@item
+The procedures @code{make-list}, @code{list-copy}, @code{list-set!},
+@code{string-map}, @code{string-for-each}, @code{string->vector},
+@code{vector-append},
+@code{vector-copy}, @code{vector-map}, @code{vector-for-each},
+@code{vector->string}, @code{vector-copy!}, and @code{string-copy!}
+have been added to round out the sequence operations.
+
+@item
+Some string and vector procedures support processing of part of a string or vector using
+optional @var{start} and @var{end} arguments.
+
+@item
+Some list procedures are now defined on circular lists.
+
+@item
+Implementations may provide any subset of the full Unicode
+repertoire that includes ASCII, but implementations must support any
+such subset in a way consistent with Unicode.
+Various character and string procedures have been extended accordingly,
+and case conversion procedures added for strings.
+String comparison is no longer
+required to be consistent with character comparison, which is based
+solely on Unicode scalar values.
+The new @code{digit-value} procedure has been added to obtain the numerical
+value of a numeric character.
+
+@item
+There are now two additional comment syntaxes: @code{#;} to
+skip the next datum, and @code{#|} ... @code{|#}
+for nestable block comments.
+
+@item
+Data prefixed with datum labels @code{#<}@var{n}@code{>=} can be referenced
+with @code{#<}@var{n}@code{>#}, allowing for reading and writing of data with
+shared structure.
+
+@item
+Strings and symbols now allow mnemonic and numeric escape
+sequences, and the list of named characters has been extended.
+
+@item
+The procedures @code{file-exists?} and @code{delete-file} are available in the
+@code{(scheme file)} library.
+
+@item
+An interface to the system environment, command line, and process exit status is
+available in the @code{(scheme process-context)} library.
+
+@item
+Procedures for accessing time-related values are available in the
+@code{(scheme time)} library.
+
+@item
+A less irregular set of integer division operators is provided
+with new and clearer names.
+
+@item
+The @code{load} procedure now accepts a second argument specifying the environment to
+load into.
+
+@item
+The @code{call-with-current-continuation} procedure now has the synonym
+@code{call/cc}.
+
+@item
+The semantics of read-eval-print loops are now partly prescribed,
+requiring the redefinition of procedures, but not syntax keywords, to have retroactive effect.
+
+@item
+The formal semantics now handles @code{dynamic-wind}.
+
+@end itemize
@node Incompatibilities with R6RS
-@section Incompatibilities with R6RS
-
-This section enumerates the incompatibilities between R7RS and the ``Revised6 report''
-[33] and its accompanying Standard Libraries document.
+@section Incompatibilities with @rsixrs{}
This list is not authoritative, and is possibly incomplete.
-* R7RS libraries begin with the keyword define-library rather than library in order to
- make them syntactically distinguishable from R6RS libraries. In R7RS terms, the body of
- an R6RS library consists of a single export declaration followed by a single import
- declaration, followed by commands and definitions. In R7RS, commands and definitions
- are not permitted directly within the body: they have to be wrapped in a begin library
- declaration.
-
-* There is no direct R6RS equivalent of the include, include-ci,
- include-library-declarations, or cond-expand library declarations. On the other hand,
- the R7RS library syntax does not support phase or version specifications.
-
-* The grouping of standardized identifiers into libraries is different from the R6RS
- approach. In particular, procedures which are optional in R5RS either expressly or by
- implication, have been removed from the base library. Only the base library itself is an
- absolute requirement.
-
-* No form of identifier syntax is provided.
-
-* Internal syntax definitions are allowed, but uses of a syntax form cannot appear before
- its definition; the even/odd example given in R6RS is not allowed.
-
-* The R6RS exception system was incorporated as-is, but the condition types have been
- left unspecified. In particular, where R6RS requires a condition of a specified type to be
- signaled, R7RS says only ``it is an error'', leaving the question of signaling open.
-
-* Full Unicode support is not required. Normalization is not provided. Character
- comparisons are defined by Unicode, but string comparisons are
- implementation-dependent. Non-Unicode characters are permitted.
-
-* The full numeric tower is optional as in R5RS, but optional support for IEEE infinities,
- NaN, and was adopted from R6RS. Most clarifications on numeric results were also
- adopted, but the semantics of the R6RS procedures real?, rational?, and integer? were
- not adopted. (Note that the R5RS/R7RS semantics are available in R6RS using
- real-valued?, rational-valued?, and integer-valued?). The R6RS division operators div,
- mod, div-and-mod, div0, mod0 and div0-and-mod0 are not provided.
-
-* When a result is unspecified, it is still required to be a single value. However, non-final
- expressions in a body can return any number of values.
-
-* The semantics of map and for-each have been changed to use the SRFI 1 [30] early
- termination behavior. Likewise, assoc and member take an optional equal? argument
- as in SRFI 1, instead of the separate assp and memp procedures of R6RS.
-
-* The R6RS quasiquote clarifications have been adopted, with the exception of
- multiple-argument unquote and unquote-splicing.
-
-* The R6RS method of specifying mantissa widths was not adopted.
-
-* String ports are compatible with SRFI 6 [7] rather than R6RS.
-
-* R6RS-style bytevectors are included, but only the unsigned byte (u8) procedures have
- been provided. The lexical syntax uses #u8 for compatibility with SRFI 4 [13], rather than
- the R6RS #vu8 style.
-
-* The utility macros when and unless are provided, but their result is left unspecified.
-
-* The remaining features of the Standard Libraries document were left to future
- standardization efforts.
+@itemize @bullet
+
+@item
+@rsevenrs{} libraries begin with the keyword @code{define-library}
+rather than @code{library} in order to make them syntactically
+distinguishable from @rsixrs{} libraries.
+In @rsevenrs{} terms, the body of an @rsixrs{} library consists
+of a single export declaration followed by a single import declaration,
+followed by commands and definitions. In @rsevenrs, commands and
+definitions are not permitted directly within the body: they have to be be wrapped in a @code{begin}
+library declaration.
+
+@item
+There is no direct @rsixrs{} equivalent of the @code{include}, @code{include-ci},
+@code{include-library-declarations}, or @code{cond-expand} library declarations.
+On the other hand, the @rsevenrs{} library syntax does not support phase or version specifications.
+
+@item
+The grouping of standardized identifiers into libraries is different from the @rsixrs{}
+approach. In particular, procedures which are optional in @rfivers{}, either expressly
+or by implication, have been removed from the base library.
+Only the base library itself is an absolute requirement.
+
+@item
+No form of identifier syntax is provided.
+
+@item
+Internal syntax definitions are allowed, but uses of a syntax form
+cannot appear before its definition; the @code{even}/@code{odd} example given in
+@rsixrs{} is not allowed.
+
+@item
+The @rsixrs{} exception system was incorporated as-is, but the condition
+types have been left unspecified. In particular, where @rsixrs{} requires
+a condition of a specified type to be signaled, @rsevenrs{} says only
+``it is an error'', leaving the question of signaling open.
+
+@item
+Full Unicode support is not required.
+Normalization is not provided.
+Character comparisons are
+defined by Unicode, but string comparisons are implementation-dependent.
+Non-Unicode characters are permitted.
+
+@item
+The full numeric tower is optional as in @rfivers{}, but optional support for IEEE
+infinities, NaN, and @minus{}0.0 was adopted from @rsixrs. Most clarifications on
+numeric results were also adopted, but the @rsixrs{} procedures @code{real-valued?},
+@code{rational-valued?}, and @code{integer-valued}? were not.
+The @rsixrs{} division operators @code{div}, @code{mod}, @code{div-and-mod},
+@code{div0}, @code{mod0} and @code{div0-and-mod0} are not provided.
+
+@item
+When a result is unspecified, it is still required to be a single value.
+However, non-final expressions
+in a body can return any number of values.
+
+@item
+The semantics of @code{map} and @code{for-each} have been changed to use
+the SRFI 1 early termination behavior. Likewise,
+@code{assoc} and @code{member} take an optional @code{equal?} argument as in SRFI 1,
+instead of the separate @code{assp} and @code{memp} procedures of @rsixrs{}.
+@c cite{srfi1}
+
+@item
+The @rsixrs{} @code{quasiquote} clarifications have been adopted, with the
+exception of multiple-argument @code{unquote} and
+@code{unquote-splicing}.
+
+@item
+The @rsixrs{} method of specifying mantissa widths was not adopted.
+
+@item
+String ports are compatible with SRFI 6 rather than @rsixrs{}.
+@c cite{srfi6}
+
+@item
+@rsixrs{}-style bytevectors are included, but
+only the unsigned byte (@code{u8}) procedures have been provided.
+The lexical syntax uses @code{#u8} for compatibility
+with SRFI 4, rather than the @rsixrs{} @code{#vu8} style.
+@c cite{srfi4}
+
+@item
+The utility macros @code{when} and @code{unless} are provided, but
+their result is left unspecified.
+
+@item
+The remaining features of the Standard Libraries document were
+left to future standardization efforts.
+
+@end itemize