1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 12:20:26 +02:00

* Miscellaneous small doc updates and fixes.

This commit is contained in:
Neil Jerram 2001-11-13 23:44:29 +00:00
parent 409b85880d
commit 72dd0a03e0
11 changed files with 137 additions and 810 deletions

View file

@ -1,3 +1,8 @@
2001-11-13 Neil Jerram <neil@ossau.uklinux.net>
* guile.texi: Replaced by libguile version (after automatically
updating docstrings in the reference manual).
2001-11-07 Neil Jerram <neil@ossau.uklinux.net> 2001-11-07 Neil Jerram <neil@ossau.uklinux.net>
* guile.texi: Replaced by libguile version (after automatically * guile.texi: Replaced by libguile version (after automatically

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,11 @@
2001-11-13 Neil Jerram <neil@ossau.uklinux.net>
* new-docstrings.texi, scheme-data.texi: Merge recent doc
improvements from stable branch.
* scheme-options.texi: Automatic updates from docstring changes in
libguile's C source code.
2001-11-12 Neil Jerram <neil@ossau.uklinux.net> 2001-11-12 Neil Jerram <neil@ossau.uklinux.net>
* scheme-data.texi (Vtables, Structure Basics): Automatic doc * scheme-data.texi (Vtables, Structure Basics): Automatic doc

View file

@ -506,7 +506,7 @@ Internal GOOPS magic---don't use this function!
@end deffn @end deffn
@deffn primitive list* @deffn primitive list*
scm_cons_star implemented by the C function "scm_cons_star"
@end deffn @end deffn
@deffn primitive set-current-module module @deffn primitive set-current-module module
@ -564,7 +564,7 @@ Return the module of @var{ENV}, a lexical environment.
@end deffn @end deffn
@deffn primitive load-extension lib init @deffn primitive load-extension lib init
Load and initilize the extension designated by LIB and INIT. Load and initialize the extension designated by LIB and INIT.
When there is no pre-registered function for LIB/INIT, this is When there is no pre-registered function for LIB/INIT, this is
equivalent to equivalent to

View file

@ -1471,15 +1471,15 @@ between separator characters will result in an empty string in the
result list. result list.
@lisp @lisp
(string-split "root:x:0:0:root:/root:/bin/bash" #:) (string-split "root:x:0:0:root:/root:/bin/bash" #\:)
@result{} @result{}
("root" "x" "0" "0" "root" "/root" "/bin/bash") ("root" "x" "0" "0" "root" "/root" "/bin/bash")
(string-split "::" #:) (string-split "::" #\:)
@result{} @result{}
("" "" "") ("" "" "")
(string-split "" #:) (string-split "" #\:)
@result{} @result{}
("") ("")
@end lisp @end lisp
@ -2330,7 +2330,7 @@ association lists (@pxref{Association Lists}) or hash tables
lot, and does not cause any performance loss. lot, and does not cause any performance loss.
The read syntax for symbols is a sequence of letters, digits, and The read syntax for symbols is a sequence of letters, digits, and
@emph{extended alphabetic characters} that begins with a character that @dfn{extended alphabetic characters} that begins with a character that
cannot begin a number is an identifier. In addition, @code{+}, cannot begin a number is an identifier. In addition, @code{+},
@code{-}, and @code{...} are identifiers. @code{-}, and @code{...} are identifiers.
@ -2826,7 +2826,7 @@ This is the inverse of @code{make-keyword-from-dash-symbol}.
Pairs are used to combine two Scheme objects into one compound object. Pairs are used to combine two Scheme objects into one compound object.
Hence the name: A pair stores a pair of objects. Hence the name: A pair stores a pair of objects.
The data type @emph{pair} is extremely important in Scheme, just like in The data type @dfn{pair} is extremely important in Scheme, just like in
any other Lisp dialect. The reason is that pairs are not only used to any other Lisp dialect. The reason is that pairs are not only used to
make two values available as one object, but that pairs are used for make two values available as one object, but that pairs are used for
constructing lists of values. Because lists are so important in Scheme, constructing lists of values. Because lists are so important in Scheme,
@ -2863,7 +2863,7 @@ examples is as follows.
A new pair is made by calling the procedure @code{cons} with two A new pair is made by calling the procedure @code{cons} with two
arguments. Then the argument values are stored into a newly allocated arguments. Then the argument values are stored into a newly allocated
pair, and the pair is returned. The name @code{cons} stands for pair, and the pair is returned. The name @code{cons} stands for
@emph{construct}. Use the procedure @code{pair?} to test whether a "construct". Use the procedure @code{pair?} to test whether a
given Scheme object is a pair or not. given Scheme object is a pair or not.
@rnindex cons @rnindex cons
@ -2879,8 +2879,8 @@ Return @code{#t} if @var{x} is a pair; otherwise return
@code{#f}. @code{#f}.
@end deffn @end deffn
The two parts of a pair are traditionally called @emph{car} and The two parts of a pair are traditionally called @dfn{car} and
@emph{cdr}. They can be retrieved with procedures of the same name @dfn{cdr}. They can be retrieved with procedures of the same name
(@code{car} and @code{cdr}), and can be modified with the procedures (@code{car} and @code{cdr}), and can be modified with the procedures
@code{set-car!} and @code{set-cdr!}. Since a very common operation in @code{set-car!} and @code{set-cdr!}. Since a very common operation in
Scheme programs is to access the car of a pair, or the car of the cdr of Scheme programs is to access the car of a pair, or the car of the cdr of
@ -2927,8 +2927,8 @@ by @code{set-cdr!} is unspecified.
A very important data type in Scheme---as well as in all other Lisp A very important data type in Scheme---as well as in all other Lisp
dialects---is the data type @dfn{list}.@footnote{Strictly speaking, dialects---is the data type @dfn{list}.@footnote{Strictly speaking,
Scheme does not have a real datatype @emph{list}. Lists are made up of Scheme does not have a real datatype @dfn{list}. Lists are made up of
chained @emph{pairs}, and only exist by definition---a list is a chain @dfn{chained pairs}, and only exist by definition---a list is a chain
of pairs which looks like a list.} of pairs which looks like a list.}
This is the short definition of what a list is: This is the short definition of what a list is:
@ -2955,7 +2955,7 @@ or a pair which has a list in its cdr.
* List Constructors:: Creating new lists. * List Constructors:: Creating new lists.
* List Selection:: Selecting from lists, getting their length. * List Selection:: Selecting from lists, getting their length.
* Append/Reverse:: Appending and reversing lists. * Append/Reverse:: Appending and reversing lists.
* List Modifification:: Modifying list structure. * List Modification:: Modifying existing lists.
* List Searching:: Searching for list elements * List Searching:: Searching for list elements
* List Mapping:: Applying procedures to lists. * List Mapping:: Applying procedures to lists.
@end menu @end menu
@ -3013,7 +3013,7 @@ Return @code{#t} iff @var{x} is a proper list, else @code{#f}.
The predicate @code{null?} is often used in list-processing code to The predicate @code{null?} is often used in list-processing code to
tell whether a given list has run out of elements. That is, a loop tell whether a given list has run out of elements. That is, a loop
somehow deals with the elements of a list until the list satisfies somehow deals with the elements of a list until the list satisfies
@code{null?}. Then, teh algorithm terminates. @code{null?}. Then, the algorithm terminates.
@rnindex null? @rnindex null?
@deffn primitive null? x @deffn primitive null? x
@ -3161,14 +3161,11 @@ of the modified list is not lost, it is wise to save the return value of
@code{reverse!} @code{reverse!}
@end deffn @end deffn
@node List Modifification @node List Modification
@subsection List Modification @subsection List Modification
@c FIXME::martin: Review me! The following procedures modify an existing list, either by changing
elements of the list, or by changing the list structure itself.
The following procedures modify existing list. @code{list-set!} and
@code{list-cdr-set!} change which elements a list contains, the various
deletion procedures @code{delq}, @code{delv} etc.
@deffn primitive list-set! list k val @deffn primitive list-set! list k val
Set the @var{k}th element of @var{list} to @var{val}. Set the @var{k}th element of @var{list} to @var{val}.
@ -3235,7 +3232,7 @@ Like @code{delete!}, but only deletes the first occurrence of
The following procedures search lists for particular elements. They use The following procedures search lists for particular elements. They use
different comparison predicates for comparing list elements with the different comparison predicates for comparing list elements with the
object to be seached. When they fail, they return @code{#f}, otherwise object to be searched. When they fail, they return @code{#f}, otherwise
they return the sublist whose car is equal to the search object, where they return the sublist whose car is equal to the search object, where
equality depends on the equality predicate used. equality depends on the equality predicate used.
@ -3269,7 +3266,7 @@ the non-empty lists returned by @code{(list-tail @var{lst}
empty list) is returned. empty list) is returned.
@end deffn @end deffn
[FIXME: is there any reason to have the `sloppy' functions available at [FIXME: Is there any reason to have the `sloppy' functions available at
high level at all? Maybe these docs should be relegated to a "Guile high level at all? Maybe these docs should be relegated to a "Guile
Internals" node or something. -twp] Internals" node or something. -twp]
@ -3300,8 +3297,8 @@ List processing is very convenient in Scheme because the process of
iterating over the elements of a list can be highly abstracted. The iterating over the elements of a list can be highly abstracted. The
procedures in this section are the most basic iterating procedures for procedures in this section are the most basic iterating procedures for
lists. They take a procedure and one or more lists as arguments, and lists. They take a procedure and one or more lists as arguments, and
apply the procedure to each element of the list. They differ in what apply the procedure to each element of the list. They differ in their
the result of the invocation is. return value.
@rnindex map @rnindex map
@c begin (texi-doc-string "guile" "map") @c begin (texi-doc-string "guile" "map")
@ -3336,13 +3333,15 @@ return value is not specified.
Vectors are sequences of Scheme objects. Unlike lists, the length of a Vectors are sequences of Scheme objects. Unlike lists, the length of a
vector, once the vector is created, cannot be changed. The advantage of vector, once the vector is created, cannot be changed. The advantage of
vectors over lists is that the time required to access one element of a vectors over lists is that the time required to access one element of a vector
vector is constant, whereas lists have an access time linear to the given its @dfn{position} (synonymous with @dfn{index}), a zero-origin number,
index of the accessed element in the list. is constant, whereas lists have an access time linear to the position of the
accessed element in the list.
Note that the vectors documented in this section can contain any kind of Vectors can contain any kind of Scheme object; it is even possible to have
Scheme object, it is even possible to have different types of objects in different types of objects in the same vector. For vectors containing
the same vector. vectors, you may wish to use arrays, instead. Note, too, that some array
procedures operate happily on vectors (@pxref{Arrays}).
@subsection Vector Read Syntax @subsection Vector Read Syntax
@ -3353,7 +3352,7 @@ parentheses, all elements of the vector in their respective read syntax,
and finally a closing parentheses. The following are examples of the and finally a closing parentheses. The following are examples of the
read syntax for vectors; where the first vector only contains numbers read syntax for vectors; where the first vector only contains numbers
and the second three different object types: a string, a symbol and a and the second three different object types: a string, a symbol and a
number in hexidecimal notation. number in hexadecimal notation.
@lisp @lisp
#(1 2 3) #(1 2 3)
@ -3373,8 +3372,8 @@ Return @code{#t} if @var{obj} is a vector, otherwise return
@rnindex make-vector @rnindex make-vector
@deffn primitive make-vector k [fill] @deffn primitive make-vector k [fill]
Return a newly allocated vector of @var{k} elements. If a Return a newly allocated vector of @var{k} elements. If a
second argument is given, then each element is initialized to second argument is given, then each position is initialized to
@var{fill}. Otherwise the initial contents of each element is @var{fill}. Otherwise the initial contents of each position are
unspecified. unspecified.
@end deffn @end deffn
@ -3382,8 +3381,8 @@ unspecified.
@rnindex list->vector @rnindex list->vector
@deffn primitive vector . l @deffn primitive vector . l
@deffnx primitive list->vector l @deffnx primitive list->vector l
Return a newly allocated vector whose elements contain the Return a newly allocated vector composed of the given arguments.
given arguments. Analogous to @code{list}. Analogous to @code{list}.
@lisp @lisp
(vector 'a 'b 'c) @result{} #(a b c) (vector 'a 'b 'c) @result{} #(a b c)
@ -3392,8 +3391,7 @@ given arguments. Analogous to @code{list}.
@rnindex vector->list @rnindex vector->list
@deffn primitive vector->list v @deffn primitive vector->list v
Return a newly allocated list of the objects contained in the Return a newly allocated list composed of the elements of @var{v}.
elements of @var{vector}.
@lisp @lisp
(vector->list '#(dah dah didah)) @result{} (dah dah didah) (vector->list '#(dah dah didah)) @result{} (dah dah didah)
@ -3407,35 +3405,37 @@ A vector created by any of the vector constructor procedures
(@pxref{Vectors}) documented above can be modified using the (@pxref{Vectors}) documented above can be modified using the
following procedures. following procedures.
According to R5RS, using any of these procedures on literally entered @emph{NOTE:} According to R5RS, using any of these procedures on
vectors is an error, because these vectors are considered to be literally entered vectors is an error, because these vectors are
constant, although Guile currently does not detect this error. considered to be constant, although Guile currently does not detect this
error.
@rnindex vector-set! @rnindex vector-set!
@deffn primitive vector-set! vector k obj @deffn primitive vector-set! vector k obj
Store @var{obj} in position @var{k} of @var{vector}.
@var{k} must be a valid index of @var{vector}. @var{k} must be a valid index of @var{vector}.
@code{Vector-set!} stores @var{obj} in element @var{k} of @var{vector}.
The value returned by @samp{vector-set!} is unspecified. The value returned by @samp{vector-set!} is unspecified.
@lisp @lisp
(let ((vec (vector 0 '(2 2 2 2) "Anna"))) (let ((vec (vector 0 '(2 2 2 2) "Anna")))
(vector-set! vec 1 '("Sue" "Sue")) (vector-set! vec 1 '("Sue" "Sue"))
vec) @result{} #(0 ("Sue" "Sue") "Anna") vec) @result{} #(0 ("Sue" "Sue") "Anna")
(vector-set! '#(0 1 2) 1 "doe") @result{} @emph{error} ; constant vector
@end lisp @end lisp
@end deffn @end deffn
@rnindex vector-fill! @rnindex vector-fill!
@deffn primitive vector-fill! v fill @deffn primitive vector-fill! v fill
Store @var{fill} in every element of @var{vector}. The value Store @var{fill} in every position of @var{vector}. The value
returned by @code{vector-fill!} is unspecified. returned by @code{vector-fill!} is unspecified.
@end deffn @end deffn
@deffn primitive vector-move-left! vec1 start1 end1 vec2 start2 @deffn primitive vector-move-left! vec1 start1 end1 vec2 start2
Vector version of @code{substring-move-left!}. Vector version of @code{substring-move-left!} (@pxref{String
Modification}).
@end deffn @end deffn
@deffn primitive vector-move-right! vec1 start1 end1 vec2 start2 @deffn primitive vector-move-right! vec1 start1 end1 vec2 start2
Vector version of @code{substring-move-right!}. Vector version of @code{substring-move-right!} (@pxref{String
Modification}).
@end deffn @end deffn
@subsection Vector Selection @subsection Vector Selection
@ -3445,14 +3445,13 @@ size or what elements are contained in the vector.
@rnindex vector-length @rnindex vector-length
@deffn primitive vector-length vector @deffn primitive vector-length vector
Returns the number of elements in @var{vector} as an exact integer. Return the number of elements in @var{vector} as an exact integer.
@end deffn @end deffn
@rnindex vector-ref @rnindex vector-ref
@deffn primitive vector-ref vector k @deffn primitive vector-ref vector k
Return the contents of position @var{k} of @var{vector}.
@var{k} must be a valid index of @var{vector}. @var{k} must be a valid index of @var{vector}.
@samp{Vector-ref} returns the contents of element @var{k} of
@var{vector}.
@lisp @lisp
(vector-ref '#(1 1 2 3 5 8 13 21) 5) @result{} 8 (vector-ref '#(1 1 2 3 5 8 13 21) 5) @result{} 8
(vector-ref '#(1 1 2 3 5 8 13 21) (vector-ref '#(1 1 2 3 5 8 13 21)
@ -3467,14 +3466,11 @@ Returns the number of elements in @var{vector} as an exact integer.
@node Records @node Records
@section Records @section Records
[FIXME: this is pasted in from Tom Lord's original guile.texi and should
be reviewed]
A @dfn{record type} is a first class object representing a user-defined A @dfn{record type} is a first class object representing a user-defined
data type. A @dfn{record} is an instance of a record type. data type. A @dfn{record} is an instance of a record type.
@deffn procedure record? obj @deffn procedure record? obj
Returns @code{#t} if @var{obj} is a record of any type and @code{#f} Return @code{#t} if @var{obj} is a record of any type and @code{#f}
otherwise. otherwise.
Note that @code{record?} may be true of any Scheme value; there is no Note that @code{record?} may be true of any Scheme value; there is no
@ -3482,17 +3478,17 @@ promise that records are disjoint with other Scheme types.
@end deffn @end deffn
@deffn procedure make-record-type type-name field-names @deffn procedure make-record-type type-name field-names
Returns a @dfn{record-type descriptor}, a value representing a new data Return a @dfn{record-type descriptor}, a value representing a new data
type disjoint from all others. The @var{type-name} argument must be a type disjoint from all others. The @var{type-name} argument must be a
string, but is only used for debugging purposes (such as the printed string, but is only used for debugging purposes (such as the printed
representation of a record of the new type). The @var{field-names} representation of a record of the new type). The @var{field-names}
argument is a list of symbols naming the @dfn{fields} of a record of the argument is a list of symbols naming the @dfn{fields} of a record of the
new type. It is an error if the list contains any duplicates. It is new type. It is an error if the list contains any duplicates. It is
unspecified how record-type descriptors are represented.@refill unspecified how record-type descriptors are represented.
@end deffn @end deffn
@deffn procedure record-constructor rtd [field-names] @deffn procedure record-constructor rtd [field-names]
Returns a procedure for constructing new members of the type represented Return a procedure for constructing new members of the type represented
by @var{rtd}. The returned procedure accepts exactly as many arguments by @var{rtd}. The returned procedure accepts exactly as many arguments
as there are symbols in the given list, @var{field-names}; these are as there are symbols in the given list, @var{field-names}; these are
used, in order, as the initial values of those fields in a new record, used, in order, as the initial values of those fields in a new record,
@ -3501,28 +3497,28 @@ fields not named in that list are unspecified. The @var{field-names}
argument defaults to the list of field names in the call to argument defaults to the list of field names in the call to
@code{make-record-type} that created the type represented by @var{rtd}; @code{make-record-type} that created the type represented by @var{rtd};
if the @var{field-names} argument is provided, it is an error if it if the @var{field-names} argument is provided, it is an error if it
contains any duplicates or any symbols not in the default list.@refill contains any duplicates or any symbols not in the default list.
@end deffn @end deffn
@deffn procedure record-predicate rtd @deffn procedure record-predicate rtd
Returns a procedure for testing membership in the type represented by Return a procedure for testing membership in the type represented by
@var{rtd}. The returned procedure accepts exactly one argument and @var{rtd}. The returned procedure accepts exactly one argument and
returns a true value if the argument is a member of the indicated record returns a true value if the argument is a member of the indicated record
type; it returns a false value otherwise.@refill type; it returns a false value otherwise.
@end deffn @end deffn
@deffn procedure record-accessor rtd field-name @deffn procedure record-accessor rtd field-name
Returns a procedure for reading the value of a particular field of a Return a procedure for reading the value of a particular field of a
member of the type represented by @var{rtd}. The returned procedure member of the type represented by @var{rtd}. The returned procedure
accepts exactly one argument which must be a record of the appropriate accepts exactly one argument which must be a record of the appropriate
type; it returns the current value of the field named by the symbol type; it returns the current value of the field named by the symbol
@var{field-name} in that record. The symbol @var{field-name} must be a @var{field-name} in that record. The symbol @var{field-name} must be a
member of the list of field-names in the call to @code{make-record-type} member of the list of field-names in the call to @code{make-record-type}
that created the type represented by @var{rtd}.@refill that created the type represented by @var{rtd}.
@end deffn @end deffn
@deffn procedure record-modifier rtd field-name @deffn procedure record-modifier rtd field-name
Returns a procedure for writing the value of a particular field of a Return a procedure for writing the value of a particular field of a
member of the type represented by @var{rtd}. The returned procedure member of the type represented by @var{rtd}. The returned procedure
accepts exactly two arguments: first, a record of the appropriate type, accepts exactly two arguments: first, a record of the appropriate type,
and second, an arbitrary Scheme value; it modifies the field named by and second, an arbitrary Scheme value; it modifies the field named by
@ -3530,31 +3526,31 @@ the symbol @var{field-name} in that record to contain the given value.
The returned value of the modifier procedure is unspecified. The symbol The returned value of the modifier procedure is unspecified. The symbol
@var{field-name} must be a member of the list of field-names in the call @var{field-name} must be a member of the list of field-names in the call
to @code{make-record-type} that created the type represented by to @code{make-record-type} that created the type represented by
@var{rtd}.@refill @var{rtd}.
@end deffn @end deffn
@deffn procedure record-type-descriptor record @deffn procedure record-type-descriptor record
Returns a record-type descriptor representing the type of the given Return a record-type descriptor representing the type of the given
record. That is, for example, if the returned descriptor were passed to record. That is, for example, if the returned descriptor were passed to
@code{record-predicate}, the resulting predicate would return a true @code{record-predicate}, the resulting predicate would return a true
value when passed the given record. Note that it is not necessarily the value when passed the given record. Note that it is not necessarily the
case that the returned descriptor is the one that was passed to case that the returned descriptor is the one that was passed to
@code{record-constructor} in the call that created the constructor @code{record-constructor} in the call that created the constructor
procedure that created the given record.@refill procedure that created the given record.
@end deffn @end deffn
@deffn procedure record-type-name rtd @deffn procedure record-type-name rtd
Returns the type-name associated with the type represented by rtd. The Return the type-name associated with the type represented by rtd. The
returned value is @code{eqv?} to the @var{type-name} argument given in returned value is @code{eqv?} to the @var{type-name} argument given in
the call to @code{make-record-type} that created the type represented by the call to @code{make-record-type} that created the type represented by
@var{rtd}.@refill @var{rtd}.
@end deffn @end deffn
@deffn procedure record-type-fields rtd @deffn procedure record-type-fields rtd
Returns a list of the symbols naming the fields in members of the type Return a list of the symbols naming the fields in members of the type
represented by @var{rtd}. The returned value is @code{equal?} to the represented by @var{rtd}. The returned value is @code{equal?} to the
field-names argument given in the call to @code{make-record-type} that field-names argument given in the call to @code{make-record-type} that
created the type represented by @var{rtd}.@refill created the type represented by @var{rtd}.
@end deffn @end deffn
@ -3678,7 +3674,7 @@ A pair object in which the first field is held constant could be:
"prpw" "prpw"
@end example @end example
Binary fields, (fields of type "u"), hold one @emph{word} each. The Binary fields, (fields of type "u"), hold one @dfn{word} each. The
size of a word is a machine dependent value defined to be equal to the size of a word is a machine dependent value defined to be equal to the
value of the C expression: @code{sizeof (long)}. value of the C expression: @code{sizeof (long)}.
@ -3892,7 +3888,7 @@ Return the vtable tag of the structure @var{handle}.
@node Conventional Arrays @node Conventional Arrays
@subsection Conventional Arrays @subsection Conventional Arrays
@dfn{Conventional arrays} are a collection of cells organised into an @dfn{Conventional arrays} are a collection of cells organized into an
arbitrary number of dimensions. Each cell can hold any kind of Scheme arbitrary number of dimensions. Each cell can hold any kind of Scheme
value and can be accessed in constant time by supplying an index for value and can be accessed in constant time by supplying an index for
each dimension. This contrasts with uniform arrays, which use memory each dimension. This contrasts with uniform arrays, which use memory
@ -3901,7 +3897,7 @@ where inserting and deleting cells is more efficient, but more time
is usually required to access a particular cell. is usually required to access a particular cell.
A conventional array is displayed as @code{#} followed by the @dfn{rank} A conventional array is displayed as @code{#} followed by the @dfn{rank}
(number of dimensions) followed by the cells, organised into dimensions (number of dimensions) followed by the cells, organized into dimensions
using parentheses. The nesting depth of the parentheses is equal to using parentheses. The nesting depth of the parentheses is equal to
the rank. the rank.
@ -3939,8 +3935,13 @@ and is described elsewhere.
@end deffn @end deffn
@deffn procedure make-array initial-value bound1 bound2 @dots{} @deffn procedure make-array initial-value bound1 bound2 @dots{}
Creates and returns an array that has as many dimensions as there are Create and return an array that has as many dimensions as there are
@var{bound}s and fills it with @var{initial-value}. @var{bound}s and fill it with @var{initial-value}. Each @var{bound}
may be a positive non-zero integer @var{N}, in which case the index for
that dimension can range from 0 through @var{N-1}; or an explicit index
range specifier in the form @code{(LOWER UPPER)}, where both @var{lower}
and @var{upper} are integers, possibly less than zero, and possibly the
same number (however, @var{lower} cannot be greater than @var{upper}).
@end deffn @end deffn
@c array-ref's type is `compiled-closure'. There's some weird stuff @c array-ref's type is `compiled-closure'. There's some weird stuff
@ -3957,9 +3958,10 @@ Return @code{#t} if its arguments would be acceptable to
@code{array-ref}. @code{array-ref}.
@end deffn @end deffn
@c fixme: why do these sigs differ? -ttn 2001/07/19 01:14:12
@deffn primitive array-set! v obj . args @deffn primitive array-set! v obj . args
@deffnx primitive uniform-array-set1! v obj args @deffnx primitive uniform-array-set1! v obj args
Sets the element at the @code{(index1, index2)} element in @var{array} to Set the element at the @code{(index1, index2)} element in @var{array} to
@var{new-value}. The value returned by array-set! is unspecified. @var{new-value}. The value returned by array-set! is unspecified.
@end deffn @end deffn
@ -4040,7 +4042,7 @@ examples:
@end deffn @end deffn
@deffn procedure array-shape array @deffn procedure array-shape array
Returns a list of inclusive bounds of integers. Return a list of inclusive bounds of integers.
@example @example
(array-shape (make-array 'foo '(-1 3) 5)) @result{} ((-1 3) (0 4)) (array-shape (make-array 'foo '(-1 3) 5)) @result{} ((-1 3) (0 4))
@end example @end example
@ -4066,20 +4068,20 @@ Return a list consisting of all the elements, in order, of
@deffn primitive array-copy! src dst @deffn primitive array-copy! src dst
@deffnx primitive array-copy-in-order! src dst @deffnx primitive array-copy-in-order! src dst
Copies every element from vector or array @var{source} to the Copy every element from vector or array @var{source} to the
corresponding element of @var{destination}. @var{destination} must have corresponding element of @var{destination}. @var{destination} must have
the same rank as @var{source}, and be at least as large in each the same rank as @var{source}, and be at least as large in each
dimension. The order is unspecified. dimension. The order is unspecified.
@end deffn @end deffn
@deffn primitive array-fill! ra fill @deffn primitive array-fill! ra fill
Stores @var{fill} in every element of @var{array}. The value returned Store @var{fill} in every element of @var{array}. The value returned
is unspecified. is unspecified.
@end deffn @end deffn
@c begin (texi-doc-string "guile" "array-equal?") @c begin (texi-doc-string "guile" "array-equal?")
@deffn primitive array-equal? ra0 ra1 @deffn primitive array-equal? ra0 ra1
Returns @code{#t} iff all arguments are arrays with the same shape, the Return @code{#t} iff all arguments are arrays with the same shape, the
same type, and have corresponding elements which are either same type, and have corresponding elements which are either
@code{equal?} or @code{array-equal?}. This function differs from @code{equal?} or @code{array-equal?}. This function differs from
@code{equal?} in that a one dimensional shared array may be @code{equal?} in that a one dimensional shared array may be
@ -4114,12 +4116,12 @@ unspecified. The order of application is unspecified.
@end deffn @end deffn
@deffn primitive array-for-each proc ra0 . lra @deffn primitive array-for-each proc ra0 . lra
@var{proc} is applied to each tuple of elements of @var{array0} @dots{} Apply @var{proc} to each tuple of elements of @var{array0} @dots{}
in row-major order. The value returned is unspecified. in row-major order. The value returned is unspecified.
@end deffn @end deffn
@deffn primitive array-index-map! ra proc @deffn primitive array-index-map! ra proc
applies @var{proc} to the indices of each element of @var{array} in Apply @var{proc} to the indices of each element of @var{array} in
turn, storing the result in the corresponding element. The value turn, storing the result in the corresponding element. The value
returned and the order of application are unspecified. returned and the order of application are unspecified.
@ -4197,16 +4199,16 @@ except that a single character from the above table is put between
long integers is displayed in the form @code{'#e(3 5 9)}. long integers is displayed in the form @code{'#e(3 5 9)}.
@deffn primitive array? v [prot] @deffn primitive array? v [prot]
Returns @code{#t} if the @var{obj} is an array, and @code{#f} if not. Return @code{#t} if the @var{obj} is an array, and @code{#f} if not.
The @var{prototype} argument is used with uniform arrays and is described The @var{prototype} argument is used with uniform arrays and is described
elsewhere. elsewhere.
@end deffn @end deffn
@deffn procedure make-uniform-array prototype bound1 bound2 @dots{} @deffn procedure make-uniform-array prototype bound1 bound2 @dots{}
Creates and returns a uniform array of type corresponding to Create and return a uniform array of type corresponding to
@var{prototype} that has as many dimensions as there are @var{bound}s @var{prototype} that has as many dimensions as there are @var{bound}s
and fills it with @var{prototype}. and fill it with @var{prototype}.
@end deffn @end deffn
@deffn primitive array-prototype ra @deffn primitive array-prototype ra
@ -4224,7 +4226,7 @@ done.
@end deffn @end deffn
@deffn primitive uniform-vector-fill! uve fill @deffn primitive uniform-vector-fill! uve fill
Stores @var{fill} in every element of @var{uve}. The value returned is Store @var{fill} in every element of @var{uve}. The value returned is
unspecified. unspecified.
@end deffn @end deffn
@ -4244,7 +4246,7 @@ fill the array, otherwise @var{prototype} is used.
@deffn primitive uniform-array-read! ra [port_or_fd [start [end]]] @deffn primitive uniform-array-read! ra [port_or_fd [start [end]]]
@deffnx primitive uniform-vector-read! uve [port-or-fdes] [start] [end] @deffnx primitive uniform-vector-read! uve [port-or-fdes] [start] [end]
Attempts to read all elements of @var{ura}, in lexicographic order, as Attempt to read all elements of @var{ura}, in lexicographic order, as
binary objects from @var{port-or-fdes}. binary objects from @var{port-or-fdes}.
If an end of file is encountered during If an end of file is encountered during
uniform-array-read! the objects up to that point only are put into @var{ura} uniform-array-read! the objects up to that point only are put into @var{ura}
@ -4306,7 +4308,7 @@ within the specified range @code{#f} is returned.
@end deffn @end deffn
@deffn primitive bit-invert! v @deffn primitive bit-invert! v
Modifies @var{bv} by replacing each element with its negation. Modify @var{bv} by replacing each element with its negation.
@end deffn @end deffn
@deffn primitive bit-set*! v kv obj @deffn primitive bit-set*! v kv obj
@ -4551,7 +4553,7 @@ use @code{list-copy} to copy the old association list before modifying
it. it.
@deffn primitive acons key value alist @deffn primitive acons key value alist
Adds a new key-value pair to @var{alist}. A new pair is Add a new key-value pair to @var{alist}. A new pair is
created whose car is @var{key} and whose cdr is @var{value}, and the created whose car is @var{key} and whose cdr is @var{value}, and the
pair is consed onto @var{alist}, and the new list is returned. This pair is consed onto @var{alist}, and the new list is returned. This
function is @emph{not} destructive; @var{alist} is not modified. function is @emph{not} destructive; @var{alist} is not modified.
@ -4585,12 +4587,12 @@ is @code{(KEY . VALUE)}, not just the value.
@deffn primitive assq key alist @deffn primitive assq key alist
@deffnx primitive assv key alist @deffnx primitive assv key alist
@deffnx primitive assoc key alist @deffnx primitive assoc key alist
Fetches the entry in @var{alist} that is associated with @var{key}. To Fetch the entry in @var{alist} that is associated with @var{key}. To
decide whether the argument @var{key} matches a particular entry in decide whether the argument @var{key} matches a particular entry in
@var{alist}, @code{assq} compares keys with @code{eq?}, @code{assv} @var{alist}, @code{assq} compares keys with @code{eq?}, @code{assv}
uses @code{eqv?} and @code{assoc} uses @code{equal?}. If @var{key} uses @code{eqv?} and @code{assoc} uses @code{equal?}. If @var{key}
cannot be found in @var{alist} (according to whichever equality cannot be found in @var{alist} (according to whichever equality
predicate is in use), then @code{#f} is returned. These functions predicate is in use), then return @code{#f}. These functions
return the entire alist entry found (i.e. both the key and the value). return the entire alist entry found (i.e. both the key and the value).
@end deffn @end deffn

View file

@ -336,13 +336,13 @@ Guile's configuration at run time.
@deffnx primitive minor-version @deffnx primitive minor-version
@deffnx primitive micro-version @deffnx primitive micro-version
Return a string describing Guile's version number, or its major, minor Return a string describing Guile's version number, or its major, minor
and micro version numbers, respectively. or micro version number, respectively.
@lisp @lisp
(version) @result{} "1.6.5" (version) @result{} "1.6.0"
(major-version) @result{} "1" (major-version) @result{} "1"
(minor-version) @result{} "6" (minor-version) @result{} "6"
(micro-version) @result{} "5" (micro-version) @result{} "0"
@end lisp @end lisp
@end deffn @end deffn

View file

@ -1,3 +1,13 @@
2001-11-13 Neil Jerram <neil@ossau.uklinux.net>
* random.c (scm_random_solid_sphere_x,
scm_random_hollow_sphere_x): Correct "shere" typos.
* hashtab.c (scm_hash_fold): Add missing apostrophe to docstring.
* version.c (scm_version): Update docstring to include
`micro-version'.
2001-11-13 Marius Vollmer <mvo@zagadka.ping.de> 2001-11-13 Marius Vollmer <mvo@zagadka.ping.de>
* modules.c (scm_c_export): Call va_end after collecting the * modules.c (scm_c_export): Call va_end after collecting the

View file

@ -117,7 +117,7 @@ scm_c_load_extension (const char *lib, const char *init)
SCM_DEFINE (scm_load_extension, "load-extension", 2, 0, 0, SCM_DEFINE (scm_load_extension, "load-extension", 2, 0, 0,
(SCM lib, SCM init), (SCM lib, SCM init),
"Load and initilize the extension designated by LIB and INIT.\n" "Load and initialize the extension designated by LIB and INIT.\n"
"When there is no pre-registered function for LIB/INIT, this is\n" "When there is no pre-registered function for LIB/INIT, this is\n"
"equivalent to\n" "equivalent to\n"
"\n" "\n"

View file

@ -524,7 +524,7 @@ SCM_DEFINE (scm_hash_fold, "hash-fold", 3, 0, 0,
"and value are successive pairs from the hash table TABLE, and\n" "and value are successive pairs from the hash table TABLE, and\n"
"prior-result is either INIT (for the first application of PROC)\n" "prior-result is either INIT (for the first application of PROC)\n"
"or the return value of the previous application of PROC.\n" "or the return value of the previous application of PROC.\n"
"For example, @code{(hash-fold acons () tab)} will convert a hash\n" "For example, @code{(hash-fold acons '() tab)} will convert a hash\n"
"table into an a-list of key-value pairs.") "table into an a-list of key-value pairs.")
#define FUNC_NAME s_scm_hash_fold #define FUNC_NAME s_scm_hash_fold
{ {

View file

@ -492,7 +492,7 @@ SCM_DEFINE (scm_random_solid_sphere_x, "random:solid-sphere!", 1, 1, 0,
"the sum of whose squares is less than 1.0.\n" "the sum of whose squares is less than 1.0.\n"
"Thinking of vect as coordinates in space of\n" "Thinking of vect as coordinates in space of\n"
"dimension n = (vector-length vect), the coordinates\n" "dimension n = (vector-length vect), the coordinates\n"
"are uniformly distributed within the unit n-shere.\n" "are uniformly distributed within the unit n-sphere.\n"
"The sum of the squares of the numbers is returned.") "The sum of the squares of the numbers is returned.")
#define FUNC_NAME s_scm_random_solid_sphere_x #define FUNC_NAME s_scm_random_solid_sphere_x
{ {
@ -516,7 +516,7 @@ SCM_DEFINE (scm_random_hollow_sphere_x, "random:hollow-sphere!", 1, 1, 0,
"Thinking of vect as coordinates in space of\n" "Thinking of vect as coordinates in space of\n"
"dimension n = (vector-length vect), the coordinates\n" "dimension n = (vector-length vect), the coordinates\n"
"are uniformly distributed over the surface of the\n" "are uniformly distributed over the surface of the\n"
"unit n-shere.") "unit n-sphere.")
#define FUNC_NAME s_scm_random_hollow_sphere_x #define FUNC_NAME s_scm_random_hollow_sphere_x
{ {
SCM_VALIDATE_VECTOR_OR_DVECTOR (1,v); SCM_VALIDATE_VECTOR_OR_DVECTOR (1,v);

View file

@ -96,12 +96,14 @@ SCM_DEFINE (scm_version, "version", 0, 0, 0,
(), (),
"@deffnx primitive major-version\n" "@deffnx primitive major-version\n"
"@deffnx primitive minor-version\n" "@deffnx primitive minor-version\n"
"Return a string describing Guile's version number, or its major or minor\n" "@deffnx primitive micro-version\n"
"version numbers, respectively.\n\n" "Return a string describing Guile's version number, or its major, minor\n"
"or micro version number, respectively.\n\n"
"@lisp\n" "@lisp\n"
"(version) @result{} \"1.3a\"\n" "(version) @result{} \"1.6.0\"\n"
"(major-version) @result{} \"1\"\n" "(major-version) @result{} \"1\"\n"
"(minor-version) @result{} \"3a\"\n" "(minor-version) @result{} \"6\"\n"
"(micro-version) @result{} \"0\"\n"
"@end lisp") "@end lisp")
#define FUNC_NAME s_scm_version #define FUNC_NAME s_scm_version
{ {