r7rs-small-texinfo

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

commit f9472240ec71f8a8fd1f87e68117f6fe7c28494c
parent e932965a3e5800ef5976450e1eb62d79d716e28a
Author: Yuval Langer <yuval.langer@gmail.com>
Date:   Tue, 30 Jan 2024 12:32:15 +0200

Add Makefile, set "procedure" in "@deffn"s as "{base library procedure}", also close some "@deffn"s with "@end deffn".

Diffstat:
Adoc/r7rs-small/Makefile | 9+++++++++
Mdoc/r7rs-small/r7rs-small.texinfo | 550+++++++++++++++++++++++++++++++++++++++++--------------------------------------
2 files changed, 292 insertions(+), 267 deletions(-)

diff --git a/doc/r7rs-small/Makefile b/doc/r7rs-small/Makefile @@ -0,0 +1,9 @@ +.PHONY: all +all: r7rs-small.pdf r7rs-small.html + printf '' + +r7rs-small.pdf: r7rs-small.texinfo + makeinfo --pdf --no-split $< + +r7rs-small.html: r7rs-small.texinfo + makeinfo --html --no-split $< diff --git a/doc/r7rs-small/r7rs-small.texinfo b/doc/r7rs-small/r7rs-small.texinfo @@ -422,25 +422,27 @@ template for a call to the procedure. Argument names in the template are italicized. Thus the header line -@deffn procedure vector-ref vector k - +@deffn {base library procedure} vector-ref vector k indicates that the procedure bound to the @code{vector-ref} variable takes two arguments, a vector @var{vector} and an exact non-negative integer -@var{k} (see below). The header lines - -@deffn procedure make-vector k +@var{k} (see below). +@end deffn -@deffn procedure make-vector k fill +The header lines +@deffn {base library procedure} make-vector k +@deffnx {base library procedure} make-vector k fill indicate that the @code{make-vector} procedure must be defined to take either one or two arguments. +@end deffn + It is an error for a procedure 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 3.2, then it is an error if that argument is not of the named @@ -2077,8 +2079,8 @@ This sections introduces parameter objects, which can be bound to new values for duration of a dynamic extent. The set of all parameter bindings at a given time is called the dynamic environment. -@deffn procedure make-parameter init -@deffnx procedure make-parameter init converter +@deffn {base library procedure} make-parameter init +@deffnx {base library procedure} make-parameter init converter Returns a newly allocated parameter object, which is a procedure that accepts zero arguments and returns the value associated with the parameter object. Initially, this value @@ -3245,7 +3247,7 @@ symmetric, reflexive, and transitive. Of the equivalence predicates described in section, eq? is the finest or most discriminating, equal? is the coarsest, and eqv? is slightly less discriminating than eq?. -@deffn procedure eqv? obj1 obj2 +@deffn {base library procedure} eqv? obj1 obj2 The @code{eqv?} procedure defines a useful equivalence relation on objects. Briefly, it returns #t if @@ -3454,7 +3456,7 @@ an implementation of @code{eqv?} that simply compares equal-sized inexact number bitwise equality is correct by the above definition. @end deffn -@deffn procedure eq? obj1 obj2 +@deffn {base library procedure} eq? obj1 obj2 The @code{eq?} procedure is similar to eqv? except that in some cases it is capable of discerning distinctions finer than those detectable by eqv?. It must always return #f when eqv? also @@ -3495,7 +3497,9 @@ Rationale: It will usually be possible to implement @code{eq?} much more efficie of two numbers in constant time, whereas @code{eq?} implemented as pointer comparison will always finish in constant time. -@deffn procedure equal? obj1 obj2 +@end deffn + +@deffn {base library procedure} equal? obj1 obj2 The @code{equal?} procedure, when applied to pairs, vectors, strings and bytevectors, recursively compares them, returning #t when the unfoldings of its arguments into (possibly infinite) @@ -3811,11 +3815,11 @@ numerical constants written using an inexact notation can be represented without accuracy; the inexact constants were chosen so that this is likely to be true in implementations that use IEEE binary doubles to represent inexact numbers. -@deffn procedure number? obj -@deffnx procedure complex? obj -@deffnx procedure real? obj -@deffnx procedure rational? obj -@deffnx procedure integer? obj +@deffn {base library procedure} number? obj +@deffnx {base library procedure} complex? obj +@deffnx {base library procedure} real? obj +@deffnx {base library procedure} rational? obj +@deffnx {base library procedure} integer? obj These numerical type predicates can be applied to any kind of argument, including non-numbers. They return #t if the object is of the named type, and otherwise they return @@ -3869,8 +3873,10 @@ number?, but unusual implementations may represent some irrational numbers exactly or may extend the number system to support some kind of non-complex numbers. -@deffn procedure exact? z -@deffnx procedure inexact? z +@end deffn + +@deffn {base library procedure} exact? z +@deffnx {base library procedure} inexact? z These numerical predicates provide tests for the exactness of a quantity. For any Scheme @@ -3883,8 +3889,9 @@ number, precisely one of these predicates is true. (inexact? 3.) @result{} #t @end example +@end deffn -@deffn procedure exact-integer? z +@deffn {base library procedure} exact-integer? z Returns #t if @@ -3898,6 +3905,7 @@ z is both exact and an integer; otherwise returns #f. (exact-integer? 32/5) @result{} #f @end example +@end deffn @deffn {inexact library procedure} finite? z @@ -3944,11 +3952,11 @@ imaginary parts or both are +nan.0. Otherwise it returns #f. @end example @end deffn -@deffn procedure = z1 z2 z3 @dots{} -@deffnx procedure < x1 x2 x3 @dots{} -@deffnx procedure > x1 x2 x3 @dots{} -@deffnx procedure <= x1 x2 x3 @dots{} -@deffnx procedure >= x1 x2 x3 @dots{} +@deffn {base library procedure} = z1 z2 z3 @dots{} +@deffnx {base library procedure} < x1 x2 x3 @dots{} +@deffnx {base library procedure} > x1 x2 x3 @dots{} +@deffnx {base library procedure} <= x1 x2 x3 @dots{} +@deffnx {base library procedure} >= x1 x2 x3 @dots{} These procedures return #t if their arguments are (respectively): equal, monotonically increasing, monotonically decreasing, monotonically non-decreasing, or monotonically @@ -3971,18 +3979,18 @@ results are unreliable because a small inaccuracy can affect the result; this is especially true of = and zero?. When in doubt, consult a numerical analyst. @end deffn -@deffn procedure zero? z -@deffnx procedure positive? x -@deffnx procedure negative? x -@deffnx procedure odd? n -@deffnx procedure even? n +@deffn {base library procedure} zero? z +@deffnx {base library procedure} positive? x +@deffnx {base library procedure} negative? x +@deffnx {base library procedure} odd? n +@deffnx {base library procedure} even? n These numerical predicates test a number for a particular property, returning #t or #f. See note above. @end deffn -@deffn procedure max x1 x2@dots{} -@deffnx procedure min x1 x2@dots{} +@deffn {base library procedure} max x1 x2@dots{} +@deffnx {base library procedure} min x1 x2@dots{} These procedures return the maximum or minimum of their arguments. @@ -4001,8 +4009,8 @@ represented as an inexact number without loss of accuracy, then the procedure ma report a violation of an implementation restriction. @end deffn -@deffn procedure + z1 @dots{} -@deffnx procedure * z1 @dots{} +@deffn {base library procedure} + z1 @dots{} +@deffnx {base library procedure} * z1 @dots{} These procedures return the sum or product of their arguments. @@ -4017,10 +4025,10 @@ These procedures return the sum or product of their arguments. @end example @end deffn -@deffn procedure - z -@deffnx procedure - z1 z2@dots{} -@deffnx procedure / z -@deffnx procedure / z1 z2@dots{} +@deffn {base library procedure} - z +@deffnx {base library procedure} - z1 z2@dots{} +@deffnx {base library procedure} / z +@deffnx {base library procedure} / z1 z2@dots{} With two or more arguments, these procedures return the difference or quotient of their arguments, associating to the left. With one argument, however, they return the additive @@ -4041,7 +4049,7 @@ other arguments is a NaN. @end example @end deffn -@deffn procedure abs x +@deffn {base library procedure} abs x The abs procedure returns the absolute value of its argument. @@ -4052,12 +4060,12 @@ The abs procedure returns the absolute value of its argument. @end example @end deffn -@deffn procedure floor/ n1 n2 -@deffnx procedure floor-quotient n1 n2 -@deffnx procedure floor-remainder n1 n2 -@deffnx procedure truncate/ n1 n2 -@deffnx procedure truncate-quotient n1 n2 -@deffnx procedure truncate-remainder n1 n2 +@deffn {base library procedure} floor/ n1 n2 +@deffnx {base library procedure} floor-quotient n1 n2 +@deffnx {base library procedure} floor-remainder n1 n2 +@deffnx {base library procedure} truncate/ n1 n2 +@deffnx {base library procedure} truncate-quotient n1 n2 +@deffnx {base library procedure} truncate-remainder n1 n2 These procedures implement number-theoretic (integer) division. It is an error if @@ -4170,9 +4178,9 @@ Examples: @end example @end deffn -@deffn procedure quotient n1 n2 -@deffnx procedure remainder n1 n2 -@deffnx procedure modulo n1 n2 +@deffn {base library procedure} quotient n1 n2 +@deffnx {base library procedure} remainder n1 n2 +@deffnx {base library procedure} modulo n1 n2 The quotient and remainder procedures are equivalent to truncate-quotient and truncate-remainder, respectively, and modulo is equivalent to floor-remainder. @@ -4181,8 +4189,8 @@ Note: These procedures are provided for backward compatibility with earlier versions of this report. @end deffn -@deffn procedure gcd n1 @dots{} -@deffn procedure lcm n1 @dots{} +@deffn {base library procedure} gcd n1 @dots{} +@deffnx {base library procedure} lcm n1 @dots{} These procedures return the greatest common divisor or least common multiple of their arguments. The result is always non-negative. @@ -4198,8 +4206,8 @@ arguments. The result is always non-negative. @end example @end deffn -@deffn procedure numerator q -@deffn procedure denominator q +@deffn {base library procedure} numerator q +@deffnx {base library procedure} denominator q These procedures return the numerator or denominator of their argument; the result is computed as if the argument was represented as a fraction in lowest terms. The @@ -4213,11 +4221,12 @@ denominator is always positive. The denominator of 0 is defined to be 1. (inexact (/ 6 4))) @result{} 2.0 @end example +@end deffn -@deffn procedure floor x -@deffnx procedure ceiling x -@deffnx procedure truncate x -@deffnx procedure round x +@deffn {base library procedure} floor x +@deffnx {base library procedure} ceiling x +@deffnx {base library procedure} truncate x +@deffnx {base library procedure} round x These procedures return integers. The floor procedure returns the largest integer not larger than @@ -4259,7 +4268,7 @@ procedure. If the argument is infinite or a NaN, then it is returned. @end example @end deffn -@deffn procedure rationalize x y +@deffn {base library procedure} rationalize x y The rationalize procedure returns the simplest rational number differing from @@ -4357,7 +4366,7 @@ these functions. When it is possible, these procedures produce a real result fro argument. @end deffn -@deffn procedure square z +@deffn {base library procedure} square z Returns the square of z. This is equivalent to @code{(* z z)}. @@ -4367,6 +4376,7 @@ Returns the square of z. This is equivalent to @code{(* z z)}. (square 2.0) @result{} 4.0 @end example +@end deffn @deffn {inexact library procedure} sqrt z @@ -4383,7 +4393,7 @@ imaginary part. @end example @end deffn -@deffn procedure exact-integer-sqrt k +@deffn {base library procedure} exact-integer-sqrt k Returns two non-negative exact integers s and r where @@ -4399,7 +4409,7 @@ k < (s + 1)2. @end example @end deffn -@deffn procedure expt z1 z2 +@deffn {base library procedure} expt z1 z2 Returns @@ -4464,8 +4474,8 @@ Rationale: The magnitude procedure is the same as abs for a real argument, but a is in the base library, whereas magnitude is in the optional complex library. @end deffn -@deffn procedure inexact z -@deffn procedure exact z +@deffn {base library procedure} inexact z +@deffnx {base library procedure} exact z The procedure inexact returns an inexact representation of @@ -4498,8 +4508,8 @@ names are clearer and shorter, as well as being compatible with R6RS. @node Numerical input and output @subsection Numerical input and output -@deffn procedure number->string z -@deffnx procedure number->string z radix +@deffn {base library procedure} number->string z +@deffnx {base library procedure} number->string z radix It is an error if @@ -4544,8 +4554,8 @@ satisfied by a result containing a decimal point. The unspecified case allows fo infinities, NaNs, and unusual representations. @end deffn -@deffn procedure string->number string -@deffnx procedure string->number string radix +@deffn {base library procedure} string->number string +@deffnx {base library procedure} string->number string radix Returns a number of the maximally precise representation expressed by the given @@ -4622,7 +4632,7 @@ programs. @end example -@deffn procedure not obj +@deffn {base library procedure} not obj The not procedure returns #t if @@ -4641,7 +4651,7 @@ obj is false, and returns #f otherwise. @end example @end deffn -@deffn procedure boolean? obj +@deffn {base library procedure} boolean? obj The boolean? predicate returns #t if @@ -4656,7 +4666,7 @@ obj is either #t or #f and returns #f otherwise. @end example @end deffn -@deffn procedure boolean=? boolean1 boolean2 boolean3 @dots{} +@deffn {base library procedure} boolean=? boolean1 boolean2 boolean3 @dots{} Returns #t if all the arguments are #t or all are #f. @end deffn @@ -4752,7 +4762,7 @@ That is, according to Scheme's grammar, every <expression> is also a <datum> (se section 7.1.2). Among other things, this permits the use of the read procedure to parse Scheme programs. See section 3.3. -@deffn procedure pair? obj +@deffn {base library procedure} pair? obj The pair? predicate returns #t if @@ -4766,7 +4776,7 @@ obj is a pair, and otherwise returns #f. @end example @end deffn -@deffn procedure cons obj1 obj2 +@deffn {base library procedure} cons obj1 obj2 Returns a newly allocated pair whose car is @@ -4784,7 +4794,7 @@ object. @end example @end deffn -@deffn procedure car pair +@deffn {base library procedure} car pair Returns the contents of the car field of @@ -4798,7 +4808,7 @@ pair. Note that it is an error to take the car of the empty list. @end example @end deffn -@deffn procedure cdr pair +@deffn {base library procedure} cdr pair Returns the contents of the cdr field of @@ -4811,7 +4821,7 @@ pair. Note that it is an error to take the cdr of the empty list. @end example @end deffn -@deffn procedure set-car! pair obj +@deffn {base library procedure} set-car! pair obj Stores @@ -4825,7 +4835,7 @@ pair. (set-car! (g) 3) @result{} error @end deffn -@deffn procedure set-cdr! pair obj +@deffn {base library procedure} set-cdr! pair obj Stores @@ -4834,10 +4844,10 @@ obj in the cdr field of pair. @end deffn -@deffn procedure caar pair -@deffnx procedure cadr pair -@deffnx procedure cdar pair -@deffnx procedure cddr pair +@deffn {base library procedure} caar pair +@deffnx {base library procedure} cadr pair +@deffnx {base library procedure} cdar pair +@deffnx {base library procedure} cddr pair These procedures are compositions of car and cdr as follows: @@ -4869,14 +4879,14 @@ principles. For example, caddr could be defined by Arbitrary compositions up to four deep are provided. -@deffn procedure null? obj +@deffn {base library procedure} null? obj Returns #t if obj is the empty list, otherwise returns #f. @end deffn -@deffn procedure list? obj +@deffn {base library procedure} list? obj Returns #t if @@ -4895,8 +4905,8 @@ terminated by the empty list. @end example @end deffn -@deffn procedure make-list k -@deffnx procedure make-list k fill +@deffn {base library procedure} make-list k +@deffnx {base library procedure} make-list k fill Returns a newly allocated list of @@ -4911,7 +4921,7 @@ fill. Otherwise the initial contents of each element is unspecified. @end example @end deffn -@deffn procedure list obj @dots{} +@deffn {base library procedure} list obj @dots{} Returns a newly allocated list of its arguments. @@ -4923,7 +4933,7 @@ Returns a newly allocated list of its arguments. @end example @end deffn -@deffn procedure length list +@deffn {base library procedure} length list Returns the length of @var{list}. @@ -4936,7 +4946,7 @@ Returns the length of @var{list}. @end example @end deffn -@deffn procedure append list@dots{} +@deffn {base library procedure} append list@dots{} The last argument, if there is one, can be of any type. @@ -4959,7 +4969,7 @@ improper list results if the last argument is not a proper list. @end example @end deffn -@deffn procedure reverse list +@deffn {base library procedure} reverse list Returns a newly allocated list consisting of the elements of @var{list} in reverse order. @@ -4973,7 +4983,7 @@ Returns a newly allocated list consisting of the elements of @end example @end deffn -@deffn procedure list-tail list k +@deffn {base library procedure} list-tail list k It is an error if @@ -4998,7 +5008,7 @@ k elements. The list-tail procedure could be defined by @end example @end deffn -@deffn procedure list-ref list k +@deffn {base library procedure} list-ref list k The @@ -5026,8 +5036,9 @@ k).) @result{} c @end example +@end deffn -@deffn procedure list-set! list k obj +@deffn {base library procedure} list-set! list k obj It is an error if @@ -5056,10 +5067,10 @@ list. @end example @end deffn -@deffn procedure memq obj list -@deffnx procedure memv obj list -@deffnx procedure member obj list -@deffnx procedure member obj list compare +@deffn {base library procedure} memq obj list +@deffnx {base library procedure} memv obj list +@deffnx {base library procedure} member obj list +@deffnx {base library procedure} member obj list compare These procedures return the first sublist of @@ -5104,10 +5115,10 @@ compare, if given, and equal? otherwise. @end example @end deffn -@deffn procedure assq obj alist -@deffnx procedure assv obj alist -@deffnx procedure assoc obj alist -@deffnx procedure assoc obj alist compare +@deffn {base library procedure} assq obj alist +@deffnx {base library procedure} assv obj alist +@deffnx {base library procedure} assoc obj alist +@deffnx {base library procedure} assoc obj alist compare It is an error if @@ -5154,7 +5165,7 @@ Rationale: Although they are often used as predicates, memq, memv, member, assq, potentially useful values rather than just #t or #f. @end deffn -@deffn procedure list-copy obj +@deffn {base library procedure} list-copy obj Returns a newly allocated copy of the given @@ -5200,7 +5211,7 @@ defeat write/read invariance, and also violate the rule that two symbols are the same if and only if their names are spelled the same. This report does not specify the behavior of implementation-dependent extensions. -@deffn procedure symbol? obj +@deffn {base library procedure} symbol? obj Returns #t if @@ -5218,7 +5229,7 @@ obj is a symbol, otherwise returns #f. @end example @end deffn -@deffn procedure symbol=? symbol1 symbol2 symbol3 @dots{} +@deffn {base library procedure} symbol=? symbol1 symbol2 symbol3 @dots{} Returns #t if all the arguments all have the same names in the sense of string=?. @@ -5226,7 +5237,7 @@ Note: The definition above assumes that none of the arguments are uninterned symbols. @end deffn -@deffn procedure symbol->string symbol +@deffn {base library procedure} symbol->string symbol Returns the name of @@ -5245,7 +5256,7 @@ procedures like string-set! to strings returned by this procedure. @end example @end deffn -@deffn procedure string->symbol string +@deffn {base library procedure} string->symbol string Returns the symbol whose name is @@ -5342,18 +5353,18 @@ quoted in programs. Some of the procedures that operate on characters ignore the difference between upper case and lower case. The procedures that ignore case have ``-ci'' (for ``case insensitive'') embedded in their names. -@deffn procedure char? obj +@deffn {base library procedure} char? obj Returns #t if obj is a character, otherwise returns #f. @end deffn -@deffn procedure char=? char1 char2 char3 @dots{} -@deffnx procedure char<? char1 char2 char3 @dots{} -@deffnx procedure char>? char1 char2 char3 @dots{} -@deffnx procedure char<=? char1 char2 char3 @dots{} -@deffnx procedure char>=? char1 char2 char3 @dots{} +@deffn {base library procedure} char=? char1 char2 char3 @dots{} +@deffnx {base library procedure} char<? char1 char2 char3 @dots{} +@deffnx {base library procedure} char>? char1 char2 char3 @dots{} +@deffnx {base library procedure} char<=? char1 char2 char3 @dots{} +@deffnx {base library procedure} char>=? char1 char2 char3 @dots{} These procedures return #t if the results of passing their arguments to char->integer are respectively equal, monotonically increasing, monotonically decreasing, @@ -5404,8 +5415,8 @@ This procedure returns the numeric value (0 to 9) of its argument if it is a num @end example @end deffn -@deffn procedure char->integer char -@deffnx procedure integer->char n +@deffn {base library procedure} char->integer char +@deffnx {base library procedure} integer->char n Given a Unicode character, char->integer returns an exact integer between 0 and #xD7FF or between #xE000 and #x10FFFF which is equal to the Unicode scalar value of that @@ -5504,15 +5515,15 @@ utf8->string (see section 6.9). It is also an error for a procedure passed to st (see section 6.10) to return a forbidden character, or for read-string (see section 6.13.2) to attempt to read one. -@deffn procedure string? obj +@deffn {base library procedure} string? obj Returns #t if obj is a string, otherwise returns #f. @end deffn -@deffn procedure make-string k -@deffnx procedure make-string k char +@deffn {base library procedure} make-string k +@deffnx {base library procedure} make-string k char The make-string procedure returns a newly allocated string of length @@ -5523,19 +5534,19 @@ char is given, then all the characters of the string are initialized to char, otherwise the contents of the string are unspecified. @end deffn -@deffn procedure string char @dots{} +@deffn {base library procedure} string char @dots{} Returns a newly allocated string composed of the arguments. It is analogous to list. @end deffn -@deffn procedure string-length string +@deffn {base library procedure} string-length string Returns the number of characters in the given string. @end deffn -@deffn procedure string-ref string k +@deffn {base library procedure} string-ref string k It is an error if @@ -5553,7 +5564,7 @@ string using zero-origin indexing. There is no requirement for this procedure to execute in constant time. @end deffn -@deffn procedure string-set! string k char +@deffn {base library procedure} string-set! string k char It is an error if @@ -5582,7 +5593,7 @@ string. There is no requirement for this procedure to execute in constant time. @end example @end deffn -@deffn procedure string=? string1 string2 string3 @dots{} +@deffn {base library procedure} string=? string1 string2 string3 @dots{} Returns #t if all the strings are the same length and contain exactly the same characters in the same positions, otherwise returns #f. @@ -5595,13 +5606,13 @@ characters in the same positions, otherwise returns #f. Specifically, these proc behave as if string-foldcase were applied to their arguments before comparing them. @end deffn -@deffn procedure string<? string1 string2 string3@dots{} +@deffn {base library procedure} string<? string1 string2 string3@dots{} @deffnx {char library procedure} string-ci<? string1 string2 string3@dots{} -@deffnx procedure string>? string1 string2 string3@dots{} +@deffnx {base library procedure} string>? string1 string2 string3@dots{} @deffnx {char library procedure} string-ci>? string1 string2 string3@dots{} -@deffnx procedure string<=? string1 string2 string3@dots{} +@deffnx {base library procedure} string<=? string1 string2 string3@dots{} @deffnx {char library procedure} string-ci<=? string1 string2 string3@dots{} -@deffnx procedure string>=? string1 string2 string3@dots{} +@deffnx {base library procedure} string>=? string1 string2 string3@dots{} @deffnx {char library procedure} string-ci>=? string1 string2 string3@dots{} These procedures return #t if their arguments are (respectively): monotonically @@ -5642,7 +5653,7 @@ However, implementations of string-downcase are not required to provide this behavior, and may choose to change Σ to σ in all cases. @end deffn -@deffn procedure substring string start end +@deffn {base library procedure} substring string start end The substring procedure returns a newly allocated string formed from the characters of @@ -5654,16 +5665,16 @@ end. This is equivalent to calling string-copy with the same arguments, but is p for backward compatibility and stylistic flexibility. @end deffn -@deffn procedure string-append string @dots{} +@deffn {base library procedure} string-append string @dots{} Returns a newly allocated string whose characters are the concatenation of the characters in the given strings. @end deffn -@deffn procedure string->list string -@deffnx procedure string->list string start -@deffnx procedure string->list string start end -@deffnx procedure list->string list +@deffn {base library procedure} string->list string +@deffnx {base library procedure} string->list string start +@deffnx {base library procedure} string->list string start end +@deffnx {base library procedure} list->string list It is an error if any element of @@ -5681,9 +5692,9 @@ list. In both procedures, order is preserved. string->list and list->string are far as equal? is concerned. @end deffn -@deffn procedure string-copy string -@deffnx procedure string-copy string start -@deffnx procedure string-copy string start end +@deffn {base library procedure} string-copy string +@deffnx {base library procedure} string-copy string start +@deffnx {base library procedure} string-copy string start end Returns a newly allocated copy of the part of the given @@ -5694,9 +5705,9 @@ start and end. @end deffn -@deffn procedure string-copy! to at from -@deffnx procedure string-copy! to at from start -@deffnx procedure string-copy! to at from start end +@deffn {base library procedure} string-copy! to at from +@deffnx {base library procedure} string-copy! to at from start +@deffnx {base library procedure} string-copy! to at from start end It is an error if @@ -5737,9 +5748,9 @@ b @result{} "a12de" @end example @end deffn -@deffn procedure string-fill! string fill -@deffnx procedure string-fill! string fill start -@deffnx procedure string-fill! string fill start end +@deffn {base library procedure} string-fill! string fill +@deffnx {base library procedure} string-fill! string fill start +@deffnx {base library procedure} string-fill! string fill start end It is an error if @@ -5777,15 +5788,15 @@ list (2 2 2 2) in element 1, and the string "Anna" in element 2 can be written a #(0 (2 2 2 2) "Anna") Vector constants are self-evaluating, so they do not need to be quoted in programs. -@deffn procedure vector? obj +@deffn {base library procedure} vector? obj Returns #t if obj is a vector; otherwise returns #f. @end deffn -@deffn procedure make-vector k -@deffnx procedure make-vector k fill +@deffn {base library procedure} make-vector k +@deffnx {base library procedure} make-vector k fill Returns a newly allocated vector of @@ -5794,7 +5805,7 @@ k elements. If a second argument is given, then each element is initialized to fill. Otherwise the initial contents of each element is unspecified. @end deffn -@deffn procedure vector obj @dots{} +@deffn {base library procedure} vector obj @dots{} Returns a newly allocated vector whose elements contain the given arguments. It is analogous to list. @@ -5806,14 +5817,14 @@ analogous to list. @end example @end deffn -@deffn procedure vector-length vector +@deffn {base library procedure} vector-length vector Returns the number of elements in vector as an exact integer. @end deffn -@deffn procedure vector-ref vector k +@deffn {base library procedure} vector-ref vector k It is an error if @@ -5840,7 +5851,7 @@ vector. @end example @end deffn -@deffn procedure vector-set! vector k obj +@deffn {base library procedure} vector-set! vector k obj It is an error if @@ -5869,10 +5880,10 @@ vector. @end example @end deffn -@deffn procedure vector->list vector -@deffnx procedure vector->list vector start -@deffnx procedure vector->list vector start end -@deffnx procedure list->vector list +@deffn {base library procedure} vector->list vector +@deffnx {base library procedure} vector->list vector start +@deffnx {base library procedure} vector->list vector start end +@deffnx {base library procedure} list->vector list The vector->list procedure returns a newly allocated list of the objects contained in the elements of @@ -5900,12 +5911,12 @@ In both procedures, order is preserved. @end example @end deffn -@deffn procedure vector->string vector -@deffnx procedure vector->string vector start -@deffnx procedure vector->string vector start end -@deffnx procedure string->vector string -@deffnx procedure string->vector string start -@deffnx procedure string->vector string start end +@deffn {base library procedure} vector->string vector +@deffnx {base library procedure} vector->string vector start +@deffnx {base library procedure} vector->string vector start end +@deffnx {base library procedure} string->vector string +@deffnx {base library procedure} string->vector string start +@deffnx {base library procedure} string->vector string start end It is an error if any element of @@ -5942,9 +5953,9 @@ In both procedures, order is preserved. @end example @end deffn -@deffn procedure vector-copy vector -@deffnx procedure vector-copy vector start -@deffnx procedure vector-copy vector start end +@deffn {base library procedure} vector-copy vector +@deffnx {base library procedure} vector-copy vector start +@deffnx {base library procedure} vector-copy vector start end Returns a newly allocated copy of the elements of the given @@ -5967,9 +5978,9 @@ c @result{} #(8 2) @end example @end deffn -@deffn procedure vector-copy! to at from -@deffnx procedure vector-copy! to at from start -@deffnx procedure vector-copy! to at from start end +@deffn {base library procedure} vector-copy! to at from +@deffnx {base library procedure} vector-copy! to at from start +@deffnx {base library procedure} vector-copy! to at from start end It is an error if @@ -6010,7 +6021,7 @@ b @result{} #(10 1 2 40 50) @end example @end deffn -@deffn procedure vector-append vector@dots{} +@deffn {base library procedure} vector-append vector@dots{} Returns a newly allocated vector whose elements are the concatenation of the elements of the given vectors. @@ -6023,9 +6034,9 @@ of the given vectors. @end example @end deffn -@deffn procedure vector-fill! vector fill -@deffnx procedure vector-fill! vector fill start -@deffnx procedure vector-fill! vector fill start end +@deffn {base library procedure} vector-fill! vector fill +@deffnx {base library procedure} vector-fill! vector fill start +@deffnx {base library procedure} vector-fill! vector fill start end The vector-fill! procedure stores @@ -6067,14 +6078,16 @@ byte @dots{}). For example, a bytevector of length 3 containing the byte 0 in el #u8(0 10 5) Bytevector constants are self-evaluating, so they do not need to be quoted in programs. -@deffn procedure bytevector? obj +@deffn {base library procedure} bytevector? obj Returns #t if obj is a bytevector. Otherwise, #f is returned. -@deffn procedure make-bytevector k -@deffnx procedure make-bytevector k byte +@end deffn + +@deffn {base library procedure} make-bytevector k +@deffnx {base library procedure} make-bytevector k byte The make-bytevector procedure returns a newly allocated bytevector of length @@ -6091,7 +6104,7 @@ byte, otherwise the contents of each element are unspecified. @end example @end deffn -@deffn procedure bytevector byte@dots{} +@deffn {base library procedure} bytevector byte@dots{} Returns a newly allocated bytevector containing its arguments. @@ -6103,14 +6116,14 @@ Returns a newly allocated bytevector containing its arguments. @end example @end deffn -@deffn procedure bytevector-length bytevector +@deffn {base library procedure} bytevector-length bytevector Returns the length of bytevector in bytes as an exact integer. @end deffn -@deffn procedure bytevector-u8-ref bytevector k +@deffn {base library procedure} bytevector-u8-ref bytevector k It is an error if @@ -6133,7 +6146,7 @@ bytevector. @end example @end deffn -@deffn procedure bytevector-u8-set! bytevector k byte +@deffn {base library procedure} bytevector-u8-set! bytevector k byte It is an error if @@ -6159,9 +6172,9 @@ bytevector. @end example @end deffn -@deffn procedure bytevector-copy bytevector -@deffnx procedure bytevector-copy bytevector start -@deffnx procedure bytevector-copy bytevector start end +@deffn {base library procedure} bytevector-copy bytevector +@deffnx {base library procedure} bytevector-copy bytevector start +@deffnx {base library procedure} bytevector-copy bytevector start end Returns a newly allocated bytevector containing the bytes in @@ -6177,10 +6190,11 @@ end. (bytevector-copy a 2 4)) @result{} #u8(3 4) @end example +@end deffn -@deffn procedure bytevector-copy! to at from -@deffnx procedure bytevector-copy! to at from start -@deffnx procedure bytevector-copy! to at from start end +@deffn {base library procedure} bytevector-copy! to at from +@deffnx {base library procedure} bytevector-copy! to at from start +@deffnx {base library procedure} bytevector-copy! to at from start end It is an error if @@ -6224,7 +6238,7 @@ Note: This procedure appears in R6RS, but places the source before the destinati contrary to other such procedures in Scheme. @end deffn -@deffn procedure bytevector-append bytevector@dots{} +@deffn {base library procedure} bytevector-append bytevector@dots{} Returns a newly allocated bytevector whose elements are the concatenation of the elements in the given bytevectors. @@ -6237,12 +6251,12 @@ elements in the given bytevectors. @end example @end deffn -@deffn procedure utf8->string bytevector -@deffnx procedure utf8->string bytevector start -@deffnx procedure utf8->string bytevector start end -@deffnx procedure string->utf8 string -@deffnx procedure string->utf8 string start -@deffnx procedure string->utf8 string start end +@deffn {base library procedure} utf8->string bytevector +@deffnx {base library procedure} utf8->string bytevector start +@deffnx {base library procedure} utf8->string bytevector start end +@deffnx {base library procedure} string->utf8 string +@deffnx {base library procedure} string->utf8 string start +@deffnx {base library procedure} string->utf8 string start end It is an error for @@ -6277,7 +6291,7 @@ execution in special ways. Procedures in this section that invoke procedure argu always do so in the same dynamic environment as the call of the original procedure. The procedure? predicate is also described here. -@deffn procedure procedure? obj +@deffn {base library procedure} procedure? obj Returns #t if @@ -6297,7 +6311,7 @@ obj is a procedure, otherwise returns #f. @end example @end deffn -@deffn procedure apply proc arg1@dots{} args +@deffn {base library procedure} apply proc arg1@dots{} args The apply procedure calls @@ -6317,7 +6331,7 @@ proc with the elements of the list @code{(append (list arg1 @dots{}) args)} as t @end example @end deffn -@deffn procedure map proc list1 list2@dots{} +@deffn {base library procedure} map proc list1 list2@dots{} It is an error if @@ -6363,7 +6377,7 @@ or (2 1) @end example @end deffn -@deffn procedure string-map proc string1 string2@dots{} +@deffn {base library procedure} string-map proc string1 string2@dots{} It is an error if @@ -6406,7 +6420,7 @@ earlier returns are not mutated. @end example @end deffn -@deffn procedure vector-map proc vector1 vector2@dots{} +@deffn {base library procedure} vector-map proc vector1 vector2@dots{} It is an error if @@ -6450,7 +6464,7 @@ or #(2 1) @end example @end deffn -@deffn procedure for-each proc list1 list2@dots{} +@deffn {base library procedure} for-each proc list1 list2@dots{} It is an error if @@ -6486,7 +6500,7 @@ proc to mutate any of the lists. @end example @end deffn -@deffn procedure string-for-each proc string1 string2@dots{} +@deffn {base library procedure} string-for-each proc string1 string2@dots{} It is an error if @@ -6519,7 +6533,7 @@ proc to mutate any of the strings. @end example @end deffn -@deffn procedure vector-for-each proc vector1 vector2@dots{} +@deffn {base library procedure} vector-for-each proc vector1 vector2@dots{} It is an error if @@ -6552,8 +6566,8 @@ proc to mutate any of the vectors. @end example @end deffn -@deffn procedure call-with-current-continuation proc -@deffnx procedure call/cc proc +@deffn {base library procedure} call-with-current-continuation proc +@deffnx {base library procedure} call/cc proc It is an error if @@ -6642,7 +6656,7 @@ Rationale: A common use of call-with-current-continuation is for structured, by creating a procedure that acts just like the current continuation. @end deffn -@deffn procedure values obj @dots{} +@deffn {base library procedure} values obj @dots{} Delivers all of its arguments to its continuation. The values procedure might be defined as follows: @@ -6656,7 +6670,7 @@ as follows: @end example @end deffn -@deffn procedure call-with-values producer consumer +@deffn {base library procedure} call-with-values producer consumer Calls its @@ -6678,7 +6692,7 @@ consumer is the continuation of the call to call-with-values. @end example @end deffn -@deffn procedure dynamic-wind before thunk after +@deffn {base library procedure} dynamic-wind before thunk after Calls @@ -6786,7 +6800,7 @@ object encapsulating information about the exception. Any procedure accepting on argument can serve as an exception handler and any object can be used to represent an exception. -@deffn procedure with-exception-handler handler thunk +@deffn {base library procedure} with-exception-handler handler thunk It is an error if @@ -6829,7 +6843,7 @@ exception. @end example @end deffn -@deffn procedure raise obj +@deffn {base library procedure} raise obj Raises an exception by invoking the current exception handler on @@ -6841,7 +6855,7 @@ same dynamic environment as the handler. The relationship between obj and the object raised by the secondary exception is unspecified. @end deffn -@deffn procedure raise-continuable obj +@deffn {base library procedure} raise-continuable obj Raises an exception by invoking the current exception handler on @@ -6870,7 +6884,7 @@ the values it returns become the values returned by the call to raise-continuabl @end example @end deffn -@deffn procedure error message obj @dots{} +@deffn {base library procedure} error message obj @dots{} Message should be a string. @@ -6894,7 +6908,7 @@ objs, known as the irritants. The procedure error-object? must return #t on such @end example @end deffn -@deffn procedure error-object? obj +@deffn {base library procedure} error-object? obj Returns #t if @@ -6903,22 +6917,22 @@ Otherwise, it returns #f. The objects used to signal errors, including those whi the predicates file-error? and read-error?, may or may not satisfy error-object?. @end deffn -@deffn procedure error-object-message error-object +@deffn {base library procedure} error-object-message error-object Returns the message encapsulated by error-object. @end deffn -@deffn procedure error-object-irritants error-object +@deffn {base library procedure} error-object-irritants error-object Returns a list of the irritants encapsulated by error-object. @end deffn -@deffn procedure read-error? obj -@deffnx procedure file-error? obj +@deffn {base library procedure} read-error? obj +@deffnx {base library procedure} file-error? obj Error type predicates. Returns #t if @@ -7050,7 +7064,7 @@ implementation-dependent. Ports can be used to access files, devices, and similar things on the host system on which the Scheme program is running. -@deffn procedure call-with-port port proc +@deffn {base library procedure} call-with-port port proc It is an error if @@ -7089,11 +7103,11 @@ output as if by open-input-file or open-output-file. The port and proc are then passed to a procedure equivalent to call-with-port. @end deffn -@deffn procedure input-port? obj -@deffnx procedure output-port? obj -@deffnx procedure textual-port? obj -@deffnx procedure binary-port? obj -@deffnx procedure port? obj +@deffn {base library procedure} input-port? obj +@deffnx {base library procedure} output-port? obj +@deffnx {base library procedure} textual-port? obj +@deffnx {base library procedure} binary-port? obj +@deffnx {base library procedure} port? obj These procedures return #t if @@ -7101,8 +7115,8 @@ obj is an input port, output port, textual port, binary port, or any kind of por respectively. Otherwise they return #f. @end deffn -@deffn procedure input-port-open? port -@deffnx procedure output-port-open? port +@deffn {base library procedure} input-port-open? port +@deffnx {base library procedure} output-port-open? port Returns #t if @@ -7110,9 +7124,9 @@ port is still open and capable of performing input or output, respectively, and otherwise. @end deffn -@deffn procedure current-input-port -@deffnx procedure current-output-port -@deffnx procedure current-error-port +@deffn {base library procedure} current-input-port +@deffnx {base library procedure} current-output-port +@deffnx {base library procedure} current-error-port Returns the current default input port, output port, or error port (an output port), respectively. These procedures are parameter objects, which can be overridden with @@ -7161,9 +7175,9 @@ given name already exists, the effect is unspecified. If the file cannot be open that satisfies file-error? is signaled. @end deffn -@deffn procedure close-port port -@deffnx procedure close-input-port port -@deffnx procedure close-output-port port +@deffn {base library procedure} close-port port +@deffnx {base library procedure} close-input-port port +@deffnx {base library procedure} close-output-port port Closes the resource associated with @@ -7178,19 +7192,19 @@ to close the input and output sides of the port independently. These routines have no effect if the port has already been closed. @end deffn -@deffn procedure open-input-string string +@deffn {base library procedure} open-input-string string Takes a string and returns a textual input port that delivers characters from the string. If the string is modified, the effect is unspecified. @end deffn -@deffn procedure open-output-string +@deffn {base library procedure} open-output-string Returns a textual output port that will accumulate characters for retrieval by get-output-string. @end deffn -@deffn procedure get-output-string port +@deffn {base library procedure} get-output-string port It is an error if @@ -7215,19 +7229,19 @@ the order they were output. If the result string is modified, the effect is unsp @end example @end deffn -@deffn procedure open-input-bytevector bytevector +@deffn {base library procedure} open-input-bytevector bytevector Takes a bytevector and returns a binary input port that delivers bytes from the bytevector. @end deffn -@deffn procedure open-output-bytevector +@deffn {base library procedure} open-output-bytevector Returns a binary output port that will accumulate bytes for retrieval by get-output-bytevector. @end deffn -@deffn procedure get-output-bytevector port +@deffn {base library procedure} get-output-bytevector port It is an error if @@ -7268,8 +7282,8 @@ representation is incomplete and therefore not parsable, an error that satisfies read-error? is signaled. @end deffn -@deffn procedure read-char -@deffnx procedure read-char port +@deffn {base library procedure} read-char +@deffnx {base library procedure} read-char port Returns the next character available from the textual input @@ -7279,8 +7293,8 @@ port to point to the following character. If no more characters are available, a object is returned. @end deffn -@deffn procedure peek-char -@deffnx procedure peek-char port +@deffn {base library procedure} peek-char +@deffnx {base library procedure} peek-char port Returns the next character available from the textual input @@ -7299,8 +7313,8 @@ call to peek-char on an interactive port will hang waiting for input whenever a read-char would have hung. @end deffn -@deffn procedure read-line -@deffnx procedure read-line port +@deffn {base library procedure} read-line +@deffnx {base library procedure} read-line port Returns the next line of text available from the textual input @@ -7317,7 +7331,7 @@ character followed by a linefeed character. Implementations may also recognize o end of line characters or sequences. @end deffn -@deffn procedure eof-object? obj +@deffn {base library procedure} eof-object? obj Returns #t if @@ -7326,13 +7340,13 @@ will vary among implementations, but in any case no end-of-file object will ever object that can be read in using read. @end deffn -@deffn procedure eof-object +@deffn {base library procedure} eof-object Returns an end-of-file object, not necessarily unique. @end deffn -@deffn procedure char-ready? -@deffnx procedure char-ready? port +@deffn {base library procedure} char-ready? +@deffnx {base library procedure} char-ready? port Returns #t if a character is ready on the textual input @@ -7351,8 +7365,8 @@ char-ready? were to return #f at end of file, a port at end of file would be indistinguishable from an interactive port that has no ready characters. @end deffn -@deffn procedure read-string k -@deffnx procedure read-string k port +@deffn {base library procedure} read-string k +@deffnx {base library procedure} read-string k port Reads the next @@ -7362,8 +7376,8 @@ port into a newly allocated string in left-to-right order and returns the string characters are available before the end of file, an end-of-file object is returned. @end deffn -@deffn procedure read-u8 -@deffnx procedure read-u8 port +@deffn {base library procedure} read-u8 +@deffnx {base library procedure} read-u8 port Returns the next byte available from the binary input @@ -7373,8 +7387,8 @@ port to point to the following byte. If no more bytes are available, an end-of-f returned. @end deffn -@deffn procedure peek-u8 -@deffnx procedure peek-u8 port +@deffn {base library procedure} peek-u8 +@deffnx {base library procedure} peek-u8 port Returns the next byte available from the binary input @@ -7384,8 +7398,8 @@ port to point to the following byte. If no more bytes are available, an end-of-f returned. @end deffn -@deffn procedure u8-ready? -@deffnx procedure u8-ready? port +@deffn {base library procedure} u8-ready? +@deffnx {base library procedure} u8-ready? port Returns #t if a byte is ready on the binary input @@ -7397,8 +7411,8 @@ port is guaranteed not to hang. If the port is at end of file then u8-ready? returns #t. @end deffn -@deffn procedure read-bytevector k -@deffnx procedure read-bytevector k port +@deffn {base library procedure} read-bytevector k +@deffnx {base library procedure} read-bytevector k port Reads the next @@ -7408,10 +7422,10 @@ port into a newly allocated bytevector in left-to-right order and returns the by no bytes are available before the end of file, an end-of-file object is returned. @end deffn -@deffn procedure read-bytevector! bytevector -@deffnx procedure read-bytevector! bytevector port -@deffnx procedure read-bytevector! bytevector port start -@deffnx procedure read-bytevector! bytevector port start end +@deffn {base library procedure} read-bytevector! bytevector +@deffnx {base library procedure} read-bytevector! bytevector port +@deffnx {base library procedure} read-bytevector! bytevector port start +@deffnx {base library procedure} read-bytevector! bytevector port start end Reads the next end − start bytes, or as many as are available before the end of file, from the binary input @@ -7504,8 +7518,8 @@ Rationale: The write procedure is intended for producing machine-readable output and display for producing human-readable output. @end deffn -@deffn procedure newline -@deffnx procedure newline port +@deffn {base library procedure} newline +@deffnx {base library procedure} newline port Writes an end of line to textual output @@ -7513,8 +7527,8 @@ port. Exactly how this is done differs from one operating system to another. Ret unspecified value. @end deffn -@deffn procedure write-char char -@deffnx procedure write-char char port +@deffn {base library procedure} write-char char +@deffnx {base library procedure} write-char char port Writes the character @@ -7523,10 +7537,10 @@ char (not an external representation of the character) to the given textual outp port and returns an unspecified value. @end deffn -@deffn procedure write-string string -@deffnx procedure write-string string port -@deffnx procedure write-string string port start -@deffnx procedure write-string string port start end +@deffn {base library procedure} write-string string +@deffnx {base library procedure} write-string string port +@deffnx {base library procedure} write-string string port start +@deffnx {base library procedure} write-string string port start end Writes the characters of @@ -7539,8 +7553,8 @@ end in left-to-right order to the textual output port. @end deffn -@deffn procedure write-u8 byte -@deffnx procedure write-u8 byte port +@deffn {base library procedure} write-u8 byte +@deffnx {base library procedure} write-u8 byte port Writes the @@ -7549,10 +7563,10 @@ byte to the given binary output port and returns an unspecified value. @end deffn -@deffn procedure write-bytevector bytevector -@deffnx procedure write-bytevector bytevector port -@deffnx procedure write-bytevector bytevector port start -@deffnx procedure write-bytevector bytevector port start end +@deffn {base library procedure} write-bytevector bytevector +@deffnx {base library procedure} write-bytevector bytevector port +@deffnx {base library procedure} write-bytevector bytevector port start +@deffnx {base library procedure} write-bytevector bytevector port start end Writes the bytes of @@ -7565,8 +7579,8 @@ end in left-to-right order to the binary output port. @end deffn -@deffn procedure flush-output-port -@deffnx procedure flush-output-port port +@deffn {base library procedure} flush-output-port +@deffnx {base library procedure} flush-output-port port Flushes any buffered output from the buffer of output-port to the underlying file or device and returns an unspecified value. @@ -7612,6 +7626,8 @@ filename is not a string. The file-exists? procedure returns #t if the named file exists at the time the procedure is called, and #f otherwise. +@end deffn + @deffn {file library procedure} delete-file filename It is an error if @@ -7746,7 +7762,7 @@ an implementation-specified constant. @end example @end deffn -@deffn procedure features +@deffn {base library procedure} features Returns a list of the feature identifiers which cond-expand treats as true. It is an error to modify this list. Here is an example of what features might return: