mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-15 16:20:17 +02:00
Manual updates.
This commit is contained in:
parent
a6d344d347
commit
198586ed74
12 changed files with 194 additions and 800 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2002-03-15 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
|
* guile.texi: Replaced by regenerated libguile version.
|
||||||
|
|
||||||
2002-03-12 Neil Jerram <neil@ossau.uklinux.net>
|
2002-03-12 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
* guile.texi: Replaced by regenerated libguile version.
|
* guile.texi: Replaced by regenerated libguile version.
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,3 +1,17 @@
|
||||||
|
2002-03-15 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
|
* scheme-utility.texi (Object Properties): Revamp documentation on
|
||||||
|
object properties.
|
||||||
|
|
||||||
|
* scheme-memory.texi (Weak References): Update reference to Object
|
||||||
|
Properties node.
|
||||||
|
|
||||||
|
* guile.texi: Add macros for describing version information.
|
||||||
|
|
||||||
|
* scheme-data.texi, scheme-debug.texi, scheme-io.texi,
|
||||||
|
scheme-procedures.texi: Automatic updates from snarfed libguile
|
||||||
|
docstrings.
|
||||||
|
|
||||||
2002-03-13 Thien-Thi Nguyen <ttn@giblet.glug.org>
|
2002-03-13 Thien-Thi Nguyen <ttn@giblet.glug.org>
|
||||||
|
|
||||||
* Makefile.am (guile_toc.html): Look for guile.texi in $(srcdir).
|
* Makefile.am (guile_toc.html): Look for guile.texi in $(srcdir).
|
||||||
|
|
|
@ -50,13 +50,40 @@
|
||||||
|
|
||||||
@include version.texi
|
@include version.texi
|
||||||
|
|
||||||
|
@c Macros for describing version information. I've initially defined
|
||||||
|
@c all of these to expand to nothing, but they could perhaps be made to
|
||||||
|
@c expand to something like "New in Guile 45!" in future.
|
||||||
|
|
||||||
|
@c vnew - indicates the Guile version in which item first appeared.
|
||||||
|
@macro vnew{VERSION}
|
||||||
|
@end macro
|
||||||
|
|
||||||
|
@c vdeprecated - indicates that the item has been deprecated, and the
|
||||||
|
@c Guile version in which the deprecation started.
|
||||||
|
@macro vdeprecated{VERSION}
|
||||||
|
@end macro
|
||||||
|
|
||||||
|
@c vgone - a way of tracking items that are no longer here. In this
|
||||||
|
@c case, VERSION is the last Guile version in which the item was present.
|
||||||
|
@macro vgone{WHAT, VERSION}
|
||||||
|
@end macro
|
||||||
|
|
||||||
|
@c vchanged - indicates the Guile version in which item's behaviour
|
||||||
|
@c significantly changed.
|
||||||
|
@macro vchanged{VERSION}
|
||||||
|
@end macro
|
||||||
|
|
||||||
|
@c vnote - catchall for any additional notes.
|
||||||
|
@macro vnote{NOTE}
|
||||||
|
@end macro
|
||||||
|
|
||||||
@c @iftex
|
@c @iftex
|
||||||
@c @cropmarks
|
@c @cropmarks
|
||||||
@c @end iftex
|
@c @end iftex
|
||||||
|
|
||||||
@dircategory The Algorithmic Language Scheme
|
@dircategory The Algorithmic Language Scheme
|
||||||
@direntry
|
@direntry
|
||||||
* Guile Reference: (guile). The Guile reference manual.
|
* Guile Reference: (guile). The Guile reference manual.
|
||||||
@end direntry
|
@end direntry
|
||||||
|
|
||||||
@setchapternewpage off
|
@setchapternewpage off
|
||||||
|
@ -94,7 +121,7 @@ by the Free Software Foundation.
|
||||||
@sp 10
|
@sp 10
|
||||||
@comment The title is printed in a large font.
|
@comment The title is printed in a large font.
|
||||||
@title Guile Reference Manual
|
@title Guile Reference Manual
|
||||||
@subtitle $Id: guile.texi,v 1.13 2002-03-08 21:23:36 ttn Exp $
|
@subtitle $Id: guile.texi,v 1.14 2002-03-15 14:03:53 ossau Exp $
|
||||||
@subtitle For use with Guile @value{VERSION}
|
@subtitle For use with Guile @value{VERSION}
|
||||||
|
|
||||||
@c AUTHORS
|
@c AUTHORS
|
||||||
|
|
|
@ -321,7 +321,7 @@ Change the signature of export environment @var{env}.
|
||||||
@deffnx {C Function} scm_sys_compute_slots (class)
|
@deffnx {C Function} scm_sys_compute_slots (class)
|
||||||
Return a list consisting of the names of all slots belonging to
|
Return a list consisting of the names of all slots belonging to
|
||||||
class @var{class}, i. e. the slots of @var{class} and of all of
|
class @var{class}, i. e. the slots of @var{class} and of all of
|
||||||
its super-classes.
|
its superclasses.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Scheme Procedure} get-keyword key l default_value
|
@deffn {Scheme Procedure} get-keyword key l default_value
|
||||||
|
@ -532,7 +532,7 @@ Return the direct slots of the class @var{obj}.
|
||||||
|
|
||||||
@deffn {Scheme Procedure} class-direct-supers obj
|
@deffn {Scheme Procedure} class-direct-supers obj
|
||||||
@deffnx {C Function} scm_class_direct_supers (obj)
|
@deffnx {C Function} scm_class_direct_supers (obj)
|
||||||
Return the direct super-classes of the class @var{obj}.
|
Return the direct superclasses of the class @var{obj}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Scheme Procedure} class-name obj
|
@deffn {Scheme Procedure} class-name obj
|
||||||
|
|
|
@ -339,7 +339,7 @@ if @var{obj} is an integer number or a rational number.
|
||||||
@deffn {Scheme Procedure} rational? x
|
@deffn {Scheme Procedure} rational? x
|
||||||
@deffnx {C Function} scm_real_p (x)
|
@deffnx {C Function} scm_real_p (x)
|
||||||
Return @code{#t} if @var{x} is a rational number, @code{#f}
|
Return @code{#t} if @var{x} is a rational number, @code{#f}
|
||||||
else. Note that the set of integer values forms a subset of
|
otherwise. Note that the set of integer values forms a subset of
|
||||||
the set of rational numbers, i. e. the predicate will also be
|
the set of rational numbers, i. e. the predicate will also be
|
||||||
fulfilled if @var{x} is an integer number. Real numbers
|
fulfilled if @var{x} is an integer number. Real numbers
|
||||||
will also satisfy this predicate, because of their limited
|
will also satisfy this predicate, because of their limited
|
||||||
|
@ -379,7 +379,7 @@ properties of inexactness and limited precision as single real numbers.
|
||||||
@deffn {Scheme Procedure} complex? x
|
@deffn {Scheme Procedure} complex? x
|
||||||
@deffnx {C Function} scm_number_p (x)
|
@deffnx {C Function} scm_number_p (x)
|
||||||
Return @code{#t} if @var{x} is a complex number, @code{#f}
|
Return @code{#t} if @var{x} is a complex number, @code{#f}
|
||||||
else. Note that the sets of real, rational and integer
|
otherwise. Note that the sets of real, rational and integer
|
||||||
values form subsets of the set of complex numbers, i. e. the
|
values form subsets of the set of complex numbers, i. e. the
|
||||||
predicate will also be fulfilled if @var{x} is a real,
|
predicate will also be fulfilled if @var{x} is a real,
|
||||||
rational or integer number.
|
rational or integer number.
|
||||||
|
@ -1443,7 +1443,7 @@ fulfills some specified property.
|
||||||
@rnindex string?
|
@rnindex string?
|
||||||
@deffn {Scheme Procedure} string? obj
|
@deffn {Scheme Procedure} string? obj
|
||||||
@deffnx {C Function} scm_string_p (obj)
|
@deffnx {C Function} scm_string_p (obj)
|
||||||
Return @code{#t} iff @var{obj} is a string, else @code{#f}.
|
Return @code{#t} if @var{obj} is a string, else @code{#f}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Scheme Procedure} string-null? str
|
@deffn {Scheme Procedure} string-null? str
|
||||||
|
|
|
@ -51,7 +51,7 @@ allocated.
|
||||||
@deffnx {C Function} scm_debug_options (setting)
|
@deffnx {C Function} scm_debug_options (setting)
|
||||||
Option interface for the debug options. Instead of using
|
Option interface for the debug options. Instead of using
|
||||||
this procedure directly, use the procedures @code{debug-enable},
|
this procedure directly, use the procedures @code{debug-enable},
|
||||||
@code{debug-disable}, @code{debug-set!} and @var{debug-options}.
|
@code{debug-disable}, @code{debug-set!} and @code{debug-options}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Scheme Procedure} with-traps thunk
|
@deffn {Scheme Procedure} with-traps thunk
|
||||||
|
|
|
@ -890,7 +890,7 @@ always returns the end-of-file object when read from.
|
||||||
@deffn {Scheme Procedure} %make-void-port mode
|
@deffn {Scheme Procedure} %make-void-port mode
|
||||||
@deffnx {C Function} scm_sys_make_void_port (mode)
|
@deffnx {C Function} scm_sys_make_void_port (mode)
|
||||||
Create and return a new void port. A void port acts like
|
Create and return a new void port. A void port acts like
|
||||||
/dev/null. The @var{mode} argument
|
@file{/dev/null}. The @var{mode} argument
|
||||||
specifies the input/output modes for this port: see the
|
specifies the input/output modes for this port: see the
|
||||||
documentation for @code{open-file} in @ref{File Ports}.
|
documentation for @code{open-file} in @ref{File Ports}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
|
@ -199,8 +199,8 @@ as soon as the value is no longer in use. Entries in a doubly weak hash
|
||||||
disappear when either the key or the value are not used anywhere else
|
disappear when either the key or the value are not used anywhere else
|
||||||
anymore.
|
anymore.
|
||||||
|
|
||||||
Property lists offer the same kind of functionality as weak key hashes
|
Object properties offer the same kind of functionality as weak key
|
||||||
in many situations. (@pxref{Property Lists})
|
hashes in many situations. (@pxref{Object Properties})
|
||||||
|
|
||||||
Here's an example (a little bit strained perhaps, but one of the
|
Here's an example (a little bit strained perhaps, but one of the
|
||||||
examples is actually used in Guile):
|
examples is actually used in Guile):
|
||||||
|
|
|
@ -738,9 +738,7 @@ environment.
|
||||||
Return a @dfn{macro} which, when a symbol defined to this value
|
Return a @dfn{macro} which, when a symbol defined to this value
|
||||||
appears as the first symbol in an expression, evaluates the
|
appears as the first symbol in an expression, evaluates the
|
||||||
result of applying @var{code} to the expression and the
|
result of applying @var{code} to the expression and the
|
||||||
environment. The value returned from @var{code} which has been
|
environment. For example:
|
||||||
passed to @code{procedure->memoizing-macro} replaces the form
|
|
||||||
passed to @var{code}. For example:
|
|
||||||
|
|
||||||
@lisp
|
@lisp
|
||||||
(define trace
|
(define trace
|
||||||
|
|
|
@ -10,8 +10,7 @@ applications, they are collected in a @dfn{utility} chapter.
|
||||||
|
|
||||||
@menu
|
@menu
|
||||||
* Equality:: When are two values `the same'?
|
* Equality:: When are two values `the same'?
|
||||||
* Property Lists:: Managing meta-information about Scheme objects.
|
* Object Properties:: A modern interface to object properties.
|
||||||
* Primitive Properties:: A modern interface to object properties.
|
|
||||||
* Sorting:: Sort utility procedures.
|
* Sorting:: Sort utility procedures.
|
||||||
* Copying:: Copying deep structures.
|
* Copying:: Copying deep structures.
|
||||||
* General Conversion:: Converting objects to strings.
|
* General Conversion:: Converting objects to strings.
|
||||||
|
@ -75,48 +74,78 @@ terminate if its arguments are circular data structures.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
|
|
||||||
@node Property Lists
|
@node Object Properties
|
||||||
@section Property Lists
|
@section Object Properties
|
||||||
|
|
||||||
Every object in the system can have a @dfn{property list} that may
|
It's often useful to associate a piece of additional information with a
|
||||||
be used for information about that object. For example, a
|
Scheme object even though that object does not have a dedicated slot
|
||||||
function may have a property list that includes information about
|
available in which the additional information could be stored. Object
|
||||||
the source file in which it is defined.
|
properties allow you to do just that.
|
||||||
|
|
||||||
Property lists are implemented as assq lists (@pxref{Association Lists}).
|
An object property is most commonly used to associate one kind of
|
||||||
|
additional information with each instance of a class of similar Scheme
|
||||||
|
objects. For example, all procedures have a `name' property, which
|
||||||
|
stores the name of the variable in which the procedure was stored by a
|
||||||
|
@code{define} expression, or @code{#f} if the procedure wasn't created
|
||||||
|
by that kind of expression.
|
||||||
|
|
||||||
Currently, property lists are implemented differently for procedures and
|
Guile's representation of an object property is a procedure-with-setter
|
||||||
closures than for other kinds of objects. Therefore, when manipulating
|
(@pxref{Procedures with Setters}) that can be used with the generalized
|
||||||
a property list associated with a procedure object, use the
|
form of @code{set!} (REFFIXME) to set and retrieve that property for any
|
||||||
@code{procedure} functions; otherwise, use the @code{object} functions.
|
Scheme object. So, setting a property looks like this:
|
||||||
|
|
||||||
@deffn {Scheme Procedure} object-properties obj
|
@lisp
|
||||||
@deffnx {C Function} scm_object_properties (obj)
|
(set! (my-property obj1) value-for-obj1)
|
||||||
Return @var{obj}'s property list.
|
(set! (my-property obj2) value-for-obj2)
|
||||||
|
@end lisp
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
And retrieving values of the same property looks like this:
|
||||||
|
|
||||||
|
@lisp
|
||||||
|
(my-property obj1)
|
||||||
|
@result{}
|
||||||
|
value-for-obj1
|
||||||
|
|
||||||
|
(my-property obj2)
|
||||||
|
@result{}
|
||||||
|
value-for-obj2
|
||||||
|
@end lisp
|
||||||
|
|
||||||
|
To create an object property in the first place, use the
|
||||||
|
@code{make-object-property} procedure:
|
||||||
|
|
||||||
|
@lisp
|
||||||
|
(define my-property (make-object-property))
|
||||||
|
@end lisp
|
||||||
|
|
||||||
|
@deffn {Scheme Procedure} make-object-property
|
||||||
|
Create and return an object property. An object property is a
|
||||||
|
procedure-with-setter that can be called in two ways. @code{(set!
|
||||||
|
(@var{property} @var{obj}) @var{val})} sets @var{obj}'s @var{property}
|
||||||
|
to @var{val}. @code{(@var{property} @var{obj})} returns the current
|
||||||
|
setting of @var{obj}'s @var{property}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Scheme Procedure} set-object-properties! obj alist
|
A single object property created by @code{make-object-property} can
|
||||||
@deffnx {C Function} scm_set_object_properties_x (obj, alist)
|
associate distinct property values with all Scheme values that are
|
||||||
Set @var{obj}'s property list to @var{alist}.
|
distinguishable by @code{eq?} (including, for example, integers).
|
||||||
@end deffn
|
|
||||||
|
|
||||||
@deffn {Scheme Procedure} object-property obj key
|
Internally, object properties are implemented using a weak key hash
|
||||||
@deffnx {C Function} scm_object_property (obj, key)
|
table. This means that, as long as a Scheme value with property values
|
||||||
Return the property of @var{obj} with name @var{key}.
|
is protected from garbage collection, its property values are also
|
||||||
@end deffn
|
protected. When the Scheme value is collected, its entry in the
|
||||||
|
property table is removed and so the (ex-) property values are no longer
|
||||||
|
protected by the table.
|
||||||
|
|
||||||
@deffn {Scheme Procedure} set-object-property! obj key value
|
@menu
|
||||||
@deffnx {C Function} scm_set_object_property_x (obj, key, value)
|
* Property Primitives:: Low level property implementation.
|
||||||
In @var{obj}'s property list, set the property named @var{key}
|
* Old-fashioned Properties:: An older approach to properties.
|
||||||
to @var{value}.
|
@end menu
|
||||||
@end deffn
|
|
||||||
|
|
||||||
[Interface bug: there should be a second level of interface in which
|
|
||||||
the user provides a "property table" that is possibly private.]
|
|
||||||
|
|
||||||
|
|
||||||
@node Primitive Properties
|
@node Property Primitives
|
||||||
@section Primitive Properties
|
@subsection Low Level Property Implementation.
|
||||||
|
|
||||||
@deffn {Scheme Procedure} primitive-make-property not_found_proc
|
@deffn {Scheme Procedure} primitive-make-property not_found_proc
|
||||||
@deffnx {C Function} scm_primitive_make_property (not_found_proc)
|
@deffnx {C Function} scm_primitive_make_property (not_found_proc)
|
||||||
|
@ -148,6 +177,41 @@ Remove any value associated with @var{prop} and @var{obj}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
|
|
||||||
|
@node Old-fashioned Properties
|
||||||
|
@subsection An Older Approach to Properties
|
||||||
|
|
||||||
|
Traditionally, Lisp systems provide a different object property
|
||||||
|
interface to that provided by @code{make-object-property}, in which the
|
||||||
|
object property that is being set or retrieved is indicated by a symbol.
|
||||||
|
|
||||||
|
Guile includes this older kind of interface as well, but it may well be
|
||||||
|
removed in a future release, as it is less powerful than
|
||||||
|
@code{make-object-property} and so increases the size of the Guile
|
||||||
|
library for no benefit. (And it is trivial to write a compatibility
|
||||||
|
layer in Scheme.)
|
||||||
|
|
||||||
|
@deffn {Scheme Procedure} object-properties obj
|
||||||
|
@deffnx {C Function} scm_object_properties (obj)
|
||||||
|
Return @var{obj}'s property list.
|
||||||
|
@end deffn
|
||||||
|
|
||||||
|
@deffn {Scheme Procedure} set-object-properties! obj alist
|
||||||
|
@deffnx {C Function} scm_set_object_properties_x (obj, alist)
|
||||||
|
Set @var{obj}'s property list to @var{alist}.
|
||||||
|
@end deffn
|
||||||
|
|
||||||
|
@deffn {Scheme Procedure} object-property obj key
|
||||||
|
@deffnx {C Function} scm_object_property (obj, key)
|
||||||
|
Return the property of @var{obj} with name @var{key}.
|
||||||
|
@end deffn
|
||||||
|
|
||||||
|
@deffn {Scheme Procedure} set-object-property! obj key value
|
||||||
|
@deffnx {C Function} scm_set_object_property_x (obj, key, value)
|
||||||
|
In @var{obj}'s property list, set the property named @var{key}
|
||||||
|
to @var{value}.
|
||||||
|
@end deffn
|
||||||
|
|
||||||
|
|
||||||
@node Sorting
|
@node Sorting
|
||||||
@section Sorting
|
@section Sorting
|
||||||
|
|
||||||
|
|
|
@ -101,6 +101,7 @@ slow down execution. By default, the debugging evaluator is only used
|
||||||
when entering an interactive session. When executing a script with
|
when entering an interactive session. When executing a script with
|
||||||
@code{-s} or @code{-c}, the normal, faster evaluator is used by default.
|
@code{-s} or @code{-c}, the normal, faster evaluator is used by default.
|
||||||
|
|
||||||
|
@vnew{1.6}
|
||||||
@item --no-debug
|
@item --no-debug
|
||||||
Do not use the debugging evaluator, even when entering an interactive
|
Do not use the debugging evaluator, even when entering an interactive
|
||||||
session.
|
session.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue