1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Move GOOPS documentation into the main manual

Nothing editorial here, just the minimum to move the GOOPS documentation
into the main manual, and then still have everything build properly.
This commit is contained in:
Neil Jerram 2009-08-03 20:11:05 +01:00
parent ce2612cd88
commit eb12b40182
18 changed files with 100 additions and 225 deletions

5
README
View file

@ -299,9 +299,8 @@ Guile Documentation ==================================================
If you've never used Scheme before, then the Guile Tutorial If you've never used Scheme before, then the Guile Tutorial
(guile-tut.info) is a good starting point. The Guile Reference Manual (guile-tut.info) is a good starting point. The Guile Reference Manual
(guile.info) is the primary documentation for Guile. The Goops object (guile.info) is the primary documentation for Guile. A copy of the
system is documented separately (goops.info). A copy of the R5RS R5RS Scheme specification is included too (r5rs.info).
Scheme specification is included too (r5rs.info).
Info format versions of this documentation are installed as part of Info format versions of this documentation are installed as part of
the normal build process. The texinfo sources are under the doc the normal build process. The texinfo sources are under the doc

View file

@ -1532,7 +1532,6 @@ AC_CONFIG_FILES([
lib/Makefile lib/Makefile
benchmark-suite/Makefile benchmark-suite/Makefile
doc/Makefile doc/Makefile
doc/goops/Makefile
doc/r5rs/Makefile doc/r5rs/Makefile
doc/ref/Makefile doc/ref/Makefile
doc/tutorial/Makefile doc/tutorial/Makefile

View file

@ -21,7 +21,7 @@
AUTOMAKE_OPTIONS = gnu AUTOMAKE_OPTIONS = gnu
SUBDIRS = ref tutorial goops r5rs SUBDIRS = ref tutorial r5rs
dist_man1_MANS = guile.1 dist_man1_MANS = guile.1

View file

@ -8,10 +8,6 @@ The documentation consists of the following manuals.
- The Guile Reference Manual (guile.texi) contains (or is intended to - The Guile Reference Manual (guile.texi) contains (or is intended to
contain) reference documentation on all aspects of Guile. contain) reference documentation on all aspects of Guile.
- The GOOPS Manual (goops.texi) contains both tutorial-style and
reference documentation for using GOOPS, Guile's Object Oriented
Programming System.
- The Revised^5 Report on the Algorithmic Language Scheme (r5rs.texi). - The Revised^5 Report on the Algorithmic Language Scheme (r5rs.texi).
Please be aware that this is all very much work in progress (apart Please be aware that this is all very much work in progress (apart

View file

@ -1,29 +0,0 @@
## Process this file with Automake to create Makefile.in
##
## Copyright (C) 1998, 2004, 2006, 2008 Free Software Foundation, Inc.
##
## This file is part of GUILE.
##
## GUILE is free software; you can redistribute it and/or modify it
## under the terms of the GNU Lesser General Public License as
## published by the Free Software Foundation; either version 3, or
## (at your option) any later version.
##
## GUILE is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with GUILE; see the file COPYING.LESSER. If not,
## write to the Free Software Foundation, Inc., 51 Franklin Street,
## Fifth Floor, Boston, MA 02110-1301 USA
AUTOMAKE_OPTIONS = gnu
info_TEXINFOS = goops.texi
goops_TEXINFOS = goops-tutorial.texi \
hierarchy.eps hierarchy.png hierarchy.txt hierarchy.pdf
EXTRA_DIST = ChangeLog-2008

View file

@ -78,7 +78,9 @@ guile_TEXINFOS = preface.texi \
libguile-linking.texi \ libguile-linking.texi \
libguile-extensions.texi \ libguile-extensions.texi \
api-init.texi \ api-init.texi \
mod-getopt-long.texi mod-getopt-long.texi \
goops.texi \
goops-tutorial.texi
ETAGS_ARGS = $(info_TEXINFOS) $(guile_TEXINFOS) ETAGS_ARGS = $(info_TEXINFOS) $(guile_TEXINFOS)

View file

@ -1,20 +1,3 @@
\input texinfo
@c -*-texinfo-*-
@c %**start of header
@setfilename goops.info
@settitle Goops Manual
@set goops
@setchapternewpage odd
@paragraphindent 0
@c %**end of header
@set VERSION 0.3
@dircategory The Algorithmic Language Scheme
@direntry
* GOOPS: (goops). The GOOPS reference manual.
@end direntry
@macro goops @macro goops
GOOPS GOOPS
@end macro @end macro
@ -23,77 +6,19 @@ GOOPS
Guile Guile
@end macro @end macro
@ifinfo @node GOOPS
This file documents GOOPS, an object oriented extension for Guile. @chapter GOOPS
Copyright (C) 1999, 2000, 2001, 2003, 2006 Free Software Foundation
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
@end ifinfo
@c This title page illustrates only one of the
@c two methods of forming a title page.
@titlepage
@title Goops Manual
@subtitle For use with GOOPS @value{VERSION}
@c AUTHORS
@c The GOOPS tutorial was written by Christian Lynbech and Mikael
@c Djurfeldt, who also wrote GOOPS itself. The GOOPS reference manual
@c and MOP documentation were written by Neil Jerram and reviewed by
@c Mikael Djurfeldt.
@author Christian Lynbech
@author @email{chl@@tbit.dk}
@author
@author Mikael Djurfeldt
@author @email{djurfeldt@@nada.kth.se}
@author
@author Neil Jerram
@author @email{neil@@ossau.uklinux.net}
@c The following two commands
@c start the copyright page.
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1999, 2006 Free Software Foundation
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
@end titlepage
@node Top, Introduction, (dir), (dir)
@menu @menu
* Introduction:: * Introduction::
* Getting Started:: * Getting Started::
* Reference Manual:: * Reference Manual::
* MOP Specification:: * MOP Specification::
* Tutorial:: * Tutorial::
* Concept Index::
* Function and Variable Index::
@end menu @end menu
@iftex @node Introduction
@chapter Preliminaries
@end iftex
@node Introduction, Getting Started, Top, Top
@iftex
@section Introduction @section Introduction
@end iftex
@ifnottex
@chapter Introduction
@end ifnottex
@goops{} is the object oriented extension to @guile{}. Its @goops{} is the object oriented extension to @guile{}. Its
implementation is derived from @w{STk-3.99.3} by Erick Gallesio and implementation is derived from @w{STk-3.99.3} by Erick Gallesio and
@ -109,13 +34,8 @@ multi-method dispatch. Furthermore, the implementation relies on a true
meta object protocol, in the spirit of the one defined for CLOS meta object protocol, in the spirit of the one defined for CLOS
(@cite{Gregor Kiczales: A Metaobject Protocol}). (@cite{Gregor Kiczales: A Metaobject Protocol}).
@node Getting Started, Reference Manual, Introduction, Top @node Getting Started
@iftex
@section Getting Started @section Getting Started
@end iftex
@ifnottex
@chapter Getting Started
@end ifnottex
@menu @menu
* Running GOOPS:: * Running GOOPS::
@ -130,7 +50,7 @@ See further in the GOOPS tutorial available in this distribution in
info (goops.info) and texinfo format. info (goops.info) and texinfo format.
@end menu @end menu
@node Running GOOPS, Methods, Getting Started, Getting Started @node Running GOOPS
@subsection Running GOOPS @subsection Running GOOPS
@enumerate @enumerate
@ -157,7 +77,7 @@ arbitrary Guile interpreter.)
We're now ready to try some basic GOOPS functionality. We're now ready to try some basic GOOPS functionality.
@node Methods, User-defined types, Running GOOPS, Getting Started @node Methods
@subsection Methods @subsection Methods
@smalllisp @smalllisp
@ -170,7 +90,7 @@ We're now ready to try some basic GOOPS functionality.
@end group @end group
@end smalllisp @end smalllisp
@node User-defined types, Asking for the type of an object, Methods, Getting Started @node User-defined types
@subsection User-defined types @subsection User-defined types
@smalllisp @smalllisp
@ -200,7 +120,7 @@ v --> <3, 4>
@end group @end group
@end smalllisp @end smalllisp
@node Asking for the type of an object, , User-defined types, Getting Started @node Asking for the type of an object
@subsection Types @subsection Types
@example @example
@ -212,8 +132,8 @@ v --> <3, 4>
(is-a? v <2D-vector>) --> #t (is-a? v <2D-vector>) --> #t
@end example @end example
@node Reference Manual, MOP Specification, Getting Started, Top @node Reference Manual
@chapter Reference Manual @section Reference Manual
This chapter is the GOOPS reference manual. It aims to describe all the This chapter is the GOOPS reference manual. It aims to describe all the
syntax, procedures, options and associated concepts that a typical syntax, procedures, options and associated concepts that a typical
@ -241,7 +161,7 @@ For a detailed specification of the GOOPS metaobject protocol, see
@end menu @end menu
@node Introductory Remarks @node Introductory Remarks
@section Introductory Remarks @subsection Introductory Remarks
GOOPS is an object-oriented programming system based on a ``metaobject GOOPS is an object-oriented programming system based on a ``metaobject
protocol'' derived from the ones used in CLOS (the Common Lisp Object protocol'' derived from the ones used in CLOS (the Common Lisp Object
@ -261,19 +181,19 @@ GOOPS' power, by customizing the behaviour of GOOPS itself.
Each of the following sections of the reference manual is arranged Each of the following sections of the reference manual is arranged
such that the most basic usage is introduced first, and then subsequent such that the most basic usage is introduced first, and then subsequent
subsections discuss the related internal functions and metaobject subsubsections discuss the related internal functions and metaobject
protocols, finishing with a description of how to customize that area of protocols, finishing with a description of how to customize that area of
functionality. functionality.
These introductory remarks continue with a few words about metaobjects These introductory remarks continue with a few words about metaobjects
and the MOP. Readers who do not want to be bothered yet with the MOP and the MOP. Readers who do not want to be bothered yet with the MOP
and customization could safely skip this subsection on a first reading, and customization could safely skip this subsubsection on a first reading,
and should correspondingly skip subsequent subsections that are and should correspondingly skip subsequent subsubsections that are
concerned with internals and customization. concerned with internals and customization.
In general, this reference manual assumes familiarity with standard In general, this reference manual assumes familiarity with standard
object oriented concepts and terminology. However, some of the terms object oriented concepts and terminology. However, some of the terms
used in GOOPS are less well known, so the Terminology subsection used in GOOPS are less well known, so the Terminology subsubsection
provides definitions for these terms. provides definitions for these terms.
@menu @menu
@ -282,7 +202,7 @@ provides definitions for these terms.
@end menu @end menu
@node Metaobjects and the Metaobject Protocol @node Metaobjects and the Metaobject Protocol
@subsection Metaobjects and the Metaobject Protocol @subsubsection Metaobjects and the Metaobject Protocol
The conceptual building blocks of GOOPS are classes, slot definitions, The conceptual building blocks of GOOPS are classes, slot definitions,
instances, generic functions and methods. A class is a grouping of instances, generic functions and methods. A class is a grouping of
@ -377,7 +297,7 @@ Each subsequent section of the reference manual covers a particular area
of GOOPS functionality, and describes the generic functions that are of GOOPS functionality, and describes the generic functions that are
relevant for customization of that area. relevant for customization of that area.
We conclude this subsection by emphasizing a point that may seem We conclude this subsubsection by emphasizing a point that may seem
obvious, but contrasts with the corresponding situation in some other obvious, but contrasts with the corresponding situation in some other
MOP implementations, such as CLOS. The point is simply that an MOP implementations, such as CLOS. The point is simply that an
identifier which represents a GOOPS class or generic function is a identifier which represents a GOOPS class or generic function is a
@ -392,7 +312,7 @@ class names), but it is worth noting that GOOPS conforms fully to this
Schemely principle. Schemely principle.
@node Terminology @node Terminology
@subsection Terminology @subsubsection Terminology
It is assumed that the reader is already familiar with standard object It is assumed that the reader is already familiar with standard object
orientation concepts such as classes, objects/instances, orientation concepts such as classes, objects/instances,
@ -403,14 +323,7 @@ This section explains some of the less well known concepts and
terminology that GOOPS uses, which are assumed by the following sections terminology that GOOPS uses, which are assumed by the following sections
of the reference manual. of the reference manual.
@menu @subsubheading Metaclass
* Metaclass::
* Class Precedence List::
* Accessor::
@end menu
@node Metaclass
@subsubsection Metaclass
A @dfn{metaclass} is the class of an object which represents a GOOPS A @dfn{metaclass} is the class of an object which represents a GOOPS
class. Put more succinctly, a metaclass is a class's class. class. Put more succinctly, a metaclass is a class's class.
@ -517,8 +430,7 @@ The metaclass of @code{<my-metaclass>} is @code{<class>}.
@code{<class>}. @code{<class>}.
@end itemize @end itemize
@node Class Precedence List @subsubheading Class Precedence List
@subsubsection Class Precedence List
The @dfn{class precedence list} of a class is the list of all direct and The @dfn{class precedence list} of a class is the list of all direct and
indirect superclasses of that class, including the class itself. indirect superclasses of that class, including the class itself.
@ -548,8 +460,7 @@ precedence list}.
``Class precedence list'' is often abbreviated, in documentation and ``Class precedence list'' is often abbreviated, in documentation and
Scheme variable names, to @dfn{cpl}. Scheme variable names, to @dfn{cpl}.
@node Accessor @subsubheading Accessor
@subsubsection Accessor
An @dfn{accessor} is a generic function with both reference and setter An @dfn{accessor} is a generic function with both reference and setter
methods. methods.
@ -583,7 +494,7 @@ be invoked using the generalized @code{set!} syntax, as in:
@end example @end example
@node Defining New Classes @node Defining New Classes
@section Defining New Classes @subsection Defining New Classes
[ *fixme* Somewhere in this manual there needs to be an introductory [ *fixme* Somewhere in this manual there needs to be an introductory
discussion about GOOPS classes, generic functions and methods, covering discussion about GOOPS classes, generic functions and methods, covering
@ -622,7 +533,7 @@ the discussion there. ]
@end menu @end menu
@node Basic Class Definition @node Basic Class Definition
@subsection Basic Class Definition @subsubsection Basic Class Definition
New classes are defined using the @code{define-class} syntax, with New classes are defined using the @code{define-class} syntax, with
arguments that specify the classes that the new class should inherit arguments that specify the classes that the new class should inherit
@ -651,7 +562,7 @@ keywords and corresponding values.
@end deffn @end deffn
The standard GOOPS class and slot options are described in the following The standard GOOPS class and slot options are described in the following
subsections: see @ref{Class Options} and @ref{Slot Options}. subsubsections: see @ref{Class Options} and @ref{Slot Options}.
Example 1. Define a class that combines two pre-existing classes by Example 1. Define a class that combines two pre-existing classes by
inheritance but adds no new slots. inheritance but adds no new slots.
@ -681,13 +592,13 @@ customized via an application-defined metaclass.
@end example @end example
@node Class Options @node Class Options
@subsection Class Options @subsubsection Class Options
@deffn {class option} #:metaclass metaclass @deffn {class option} #:metaclass metaclass
The @code{#:metaclass} class option specifies the metaclass of the class The @code{#:metaclass} class option specifies the metaclass of the class
being defined. @var{metaclass} must be a class that inherits from being defined. @var{metaclass} must be a class that inherits from
@code{<class>}. For an introduction to the use of metaclasses, see @code{<class>}. For an introduction to the use of metaclasses, see
@ref{Metaobjects and the Metaobject Protocol} and @ref{Metaclass}. @ref{Metaobjects and the Metaobject Protocol} and @ref{Terminology}.
If the @code{#:metaclass} option is absent, GOOPS reuses or constructs a If the @code{#:metaclass} option is absent, GOOPS reuses or constructs a
metaclass for the new class by calling @code{ensure-metaclass} metaclass for the new class by calling @code{ensure-metaclass}
@ -714,7 +625,7 @@ environment defaults to the top-level environment in which the
@end deffn @end deffn
@node Slot Options @node Slot Options
@subsection Slot Options @subsubsection Slot Options
@deffn {slot option} #:allocation allocation @deffn {slot option} #:allocation allocation
The @code{#:allocation} option tells GOOPS how to allocate storage for The @code{#:allocation} option tells GOOPS how to allocate storage for
@ -917,7 +828,7 @@ classes.
@end deffn @end deffn
@node Class Definition Internals @node Class Definition Internals
@subsection Class Definition Internals @subsubsection Class Definition Internals
Implementation notes: @code{define-class} expands to an expression which Implementation notes: @code{define-class} expands to an expression which
@ -1030,7 +941,7 @@ class object, are described in @ref{Customizing Instance Creation},
which covers the creation and initialization of instances in general. which covers the creation and initialization of instances in general.
@node Customizing Class Definition @node Customizing Class Definition
@subsection Customizing Class Definition @subsubsection Customizing Class Definition
During the initialization of a new class, GOOPS calls a number of generic During the initialization of a new class, GOOPS calls a number of generic
functions with the newly allocated class instance as the first functions with the newly allocated class instance as the first
@ -1165,7 +1076,7 @@ typically it would perform additional class initialization steps before
and/or after calling @code{(next-method)} for the standard behaviour. and/or after calling @code{(next-method)} for the standard behaviour.
@node STKlos Compatibility @node STKlos Compatibility
@subsection STKlos Compatibility @subsubsection STKlos Compatibility
If the STKlos compatibility module is loaded, @code{define-class} is If the STKlos compatibility module is loaded, @code{define-class} is
overwritten by a STKlos-specific definition; the standard GOOPS overwritten by a STKlos-specific definition; the standard GOOPS
@ -1178,7 +1089,7 @@ definition of @code{define-class} remains available in
@end deffn @end deffn
@node Creating Instances @node Creating Instances
@section Creating Instances @subsection Creating Instances
@menu @menu
* Basic Instance Creation:: * Basic Instance Creation::
@ -1186,7 +1097,7 @@ definition of @code{define-class} remains available in
@end menu @end menu
@node Basic Instance Creation @node Basic Instance Creation
@subsection Basic Instance Creation @subsubsection Basic Instance Creation
To create a new instance of any GOOPS class, use the generic function To create a new instance of any GOOPS class, use the generic function
@code{make} or @code{make-instance}, passing the required class and any @code{make} or @code{make-instance}, passing the required class and any
@ -1223,7 +1134,7 @@ instance's class. Any unprocessed keyword value pairs are ignored.
@end deffn @end deffn
@node Customizing Instance Creation @node Customizing Instance Creation
@subsection Customizing Instance Creation @subsubsection Customizing Instance Creation
@code{make} itself is a generic function. Hence the @code{make} @code{make} itself is a generic function. Hence the @code{make}
invocation itself can be customized in the case where the new instance's invocation itself can be customized in the case where the new instance's
@ -1290,7 +1201,7 @@ and closures in the slot definitions, it is neater to write an
and initializes all the dependent slot values according to the results. and initializes all the dependent slot values according to the results.
@node Accessing Slots @node Accessing Slots
@section Accessing Slots @subsection Accessing Slots
The definition of a slot contains at the very least a slot name, and may The definition of a slot contains at the very least a slot name, and may
also contain various slot options, including getter, setter and/or also contain various slot options, including getter, setter and/or
@ -1298,7 +1209,7 @@ accessor functions for the slot.
It is always possible to access slots by name, using the various It is always possible to access slots by name, using the various
``slot-ref'' and ``slot-set!'' procedures described in the following ``slot-ref'' and ``slot-set!'' procedures described in the following
subsections. For example, subsubsections. For example,
@example @example
(define-class <my-class> () ;; Define a class with slots (define-class <my-class> () ;; Define a class with slots
@ -1354,7 +1265,7 @@ closures, see @ref{Customizing Class Definition,, compute-get-n-set}.)
@end menu @end menu
@node Instance Slots @node Instance Slots
@subsection Instance Slots @subsubsection Instance Slots
Any slot, regardless of its allocation, can be queried, referenced and Any slot, regardless of its allocation, can be queried, referenced and
set using the following four primitive procedures. set using the following four primitive procedures.
@ -1451,7 +1362,7 @@ slot-missing}).
@end deffn @end deffn
@node Class Slots @node Class Slots
@subsection Class Slots @subsubsection Class Slots
Slots whose allocation is per-class rather than per-instance can be Slots whose allocation is per-class rather than per-instance can be
referenced and set without needing to specify any particular instance. referenced and set without needing to specify any particular instance.
@ -1479,7 +1390,7 @@ function with arguments @var{class} and @var{slot-name}.
@end deffn @end deffn
@node Handling Slot Access Errors @node Handling Slot Access Errors
@subsection Handling Slot Access Errors @subsubsection Handling Slot Access Errors
GOOPS calls one of the following generic functions when a ``slot-ref'' GOOPS calls one of the following generic functions when a ``slot-ref''
or ``slot-set!'' call specifies a non-existent slot name, or tries to or ``slot-set!'' call specifies a non-existent slot name, or tries to
@ -1510,7 +1421,7 @@ message.
@end deffn @end deffn
@node Creating Generic Functions @node Creating Generic Functions
@section Creating Generic Functions @subsection Creating Generic Functions
A generic function is a collection of methods, with rules for A generic function is a collection of methods, with rules for
determining which of the methods should be applied for any given determining which of the methods should be applied for any given
@ -1526,7 +1437,7 @@ GOOPS represents generic functions as metaobjects of the class
@end menu @end menu
@node Basic Generic Function Creation @node Basic Generic Function Creation
@subsection Basic Generic Function Creation @subsubsection Basic Generic Function Creation
The following forms may be used to bind a variable to a generic The following forms may be used to bind a variable to a generic
function. Depending on that variable's pre-existing value, the generic function. Depending on that variable's pre-existing value, the generic
@ -1636,7 +1547,7 @@ form of the @code{:duplicates} option can be used instead:
@end smalllisp @end smalllisp
@node Generic Function Internals @node Generic Function Internals
@subsection Generic Function Internals @subsubsection Generic Function Internals
@code{define-generic} calls @code{ensure-generic} to upgrade a @code{define-generic} calls @code{ensure-generic} to upgrade a
pre-existing procedure value, or @code{make} with metaclass pre-existing procedure value, or @code{make} with metaclass
@ -1705,7 +1616,7 @@ accessor, passing the setter generic function as the value of the
@code{#:setter} keyword. @code{#:setter} keyword.
@node Extending Guiles Primitives @node Extending Guiles Primitives
@subsection Extending Guile's Primitives @subsubsection Extending Guile's Primitives
When GOOPS is loaded, many of Guile's primitive procedures can be When GOOPS is loaded, many of Guile's primitive procedures can be
extended by giving them a generic function definition that operates extended by giving them a generic function definition that operates
@ -1752,7 +1663,7 @@ integrated into the core of Guile. Consequently, the
procedures described in this section may disappear as well. procedures described in this section may disappear as well.
@node Adding Methods to Generic Functions @node Adding Methods to Generic Functions
@section Adding Methods to Generic Functions @subsection Adding Methods to Generic Functions
@menu @menu
* Basic Method Definition:: * Basic Method Definition::
@ -1760,7 +1671,7 @@ procedures described in this section may disappear as well.
@end menu @end menu
@node Basic Method Definition @node Basic Method Definition
@subsection Basic Method Definition @subsubsection Basic Method Definition
To add a method to a generic function, use the @code{define-method} form. To add a method to a generic function, use the @code{define-method} form.
@ -1819,7 +1730,7 @@ invocation error handling, and generic function invocation in general,
see @ref{Invoking Generic Functions}. see @ref{Invoking Generic Functions}.
@node Method Definition Internals @node Method Definition Internals
@subsection Method Definition Internals @subsubsection Method Definition Internals
@code{define-method} @code{define-method}
@ -1906,7 +1817,7 @@ function.
@end deffn @end deffn
@node Invoking Generic Functions @node Invoking Generic Functions
@section Invoking Generic Functions @subsection Invoking Generic Functions
When a variable with a generic function definition appears as the first When a variable with a generic function definition appears as the first
element of a list that is being evaluated, the Guile evaluator tries element of a list that is being evaluated, the Guile evaluator tries
@ -1928,7 +1839,7 @@ may be applied subsequently if a method that is being applied calls
@end menu @end menu
@node Determining Which Methods to Apply @node Determining Which Methods to Apply
@subsection Determining Which Methods to Apply @subsubsection Determining Which Methods to Apply
[ *fixme* Sorry - this is the area of GOOPS that I understand least of [ *fixme* Sorry - this is the area of GOOPS that I understand least of
all, so I'm afraid I have to pass on this section. Would some other all, so I'm afraid I have to pass on this section. Would some other
@ -1959,7 +1870,7 @@ kind person consider filling it in? ]
@end deffn @end deffn
@node Handling Invocation Errors @node Handling Invocation Errors
@subsection Handling Invocation Errors @subsubsection Handling Invocation Errors
@deffn generic no-method @deffn generic no-method
@deffnx method no-method (gf <generic>) args @deffnx method no-method (gf <generic>) args
@ -1987,7 +1898,7 @@ default method calls @code{goops-error} with an appropriate message.
@end deffn @end deffn
@node Redefining a Class @node Redefining a Class
@section Redefining a Class @subsection Redefining a Class
Suppose that a class @code{<my-class>} is defined using @code{define-class} Suppose that a class @code{<my-class>} is defined using @code{define-class}
(@pxref{Basic Class Definition,, define-class}), with slots that have (@pxref{Basic Class Definition,, define-class}), with slots that have
@ -2002,7 +1913,7 @@ make}). What then happens if @code{<my-class>} is redefined by calling
@end menu @end menu
@node Default Class Redefinition Behaviour @node Default Class Redefinition Behaviour
@subsection Default Class Redefinition Behaviour @subsubsection Default Class Redefinition Behaviour
GOOPS' default answer to this question is as follows. GOOPS' default answer to this question is as follows.
@ -2055,7 +1966,7 @@ Also bear in mind that, like most of GOOPS' default behaviour, it can
be customized@dots{} be customized@dots{}
@node Customizing Class Redefinition @node Customizing Class Redefinition
@subsection Customizing Class Redefinition @subsubsection Customizing Class Redefinition
When @code{define-class} notices that a class is being redefined, When @code{define-class} notices that a class is being redefined,
it constructs the new class metaobject as usual, and then invokes the it constructs the new class metaobject as usual, and then invokes the
@ -2119,7 +2030,7 @@ generic functions, and so on@dots{} The detailed protocol for all of these
is described in @ref{MOP Specification}. is described in @ref{MOP Specification}.
@node Changing the Class of an Instance @node Changing the Class of an Instance
@section Changing the Class of an Instance @subsection Changing the Class of an Instance
You can change the class of an existing instance by invoking the You can change the class of an existing instance by invoking the
generic function @code{change-class} with two arguments: the instance generic function @code{change-class} with two arguments: the instance
@ -2158,7 +2069,7 @@ invokes the @code{change-class} generic function for each existing
instance of the redefined class. instance of the redefined class.
@node Introspection @node Introspection
@section Introspection @subsection Introspection
@dfn{Introspection}, also known as @dfn{reflection}, is the name given @dfn{Introspection}, also known as @dfn{reflection}, is the name given
to the ability to obtain information dynamically about GOOPS metaobjects. to the ability to obtain information dynamically about GOOPS metaobjects.
@ -2197,7 +2108,7 @@ GOOPS equivalents --- to be obtained dynamically, at run time.
@end menu @end menu
@node Classes @node Classes
@subsection Classes @subsubsection Classes
@deffn {primitive procedure} class-name class @deffn {primitive procedure} class-name class
Return the name of class @var{class}. Return the name of class @var{class}.
@ -2257,7 +2168,7 @@ Return a list of all methods that use @var{class} or a subclass of
@end deffn @end deffn
@node Slots @node Slots
@subsection Slots @subsubsection Slots
@deffn procedure class-slot-definition class slot-name @deffn procedure class-slot-definition class slot-name
Return the slot definition for the slot named @var{slot-name} in class Return the slot definition for the slot named @var{slot-name} in class
@ -2338,7 +2249,7 @@ see @ref{Slot Options,, init-value}.
@end deffn @end deffn
@node Instances @node Instances
@subsection Instances @subsubsection Instances
@deffn {primitive procedure} class-of value @deffn {primitive procedure} class-of value
Return the GOOPS class of any Scheme @var{value}. Return the GOOPS class of any Scheme @var{value}.
@ -2359,7 +2270,7 @@ Implementation notes: @code{is-a?} uses @code{class-of} and
@var{object}. @var{object}.
@node Generic Functions @node Generic Functions
@subsection Generic Functions @subsubsection Generic Functions
@deffn {primitive procedure} generic-function-name gf @deffn {primitive procedure} generic-function-name gf
Return the name of generic function @var{gf}. Return the name of generic function @var{gf}.
@ -2371,7 +2282,7 @@ This is the value of the @var{gf} metaobject's @code{methods} slot.
@end deffn @end deffn
@node Generic Function Methods @node Generic Function Methods
@subsection Generic Function Methods @subsubsection Generic Function Methods
@deffn {primitive procedure} method-generic-function method @deffn {primitive procedure} method-generic-function method
Return the generic function that @var{method} belongs to. Return the generic function that @var{method} belongs to.
@ -2409,18 +2320,18 @@ Return an expression that prints to show the definition of method
@end deffn @end deffn
@node Miscellaneous Functions @node Miscellaneous Functions
@section Miscellaneous Functions @subsection Miscellaneous Functions
@menu @menu
* Administrative Functions:: * Administrative Functions::
* Error Handling:: * GOOPS Error Handling::
* Object Comparisons:: * Object Comparisons::
* Cloning Objects:: * Cloning Objects::
* Write and Display:: * Write and Display::
@end menu @end menu
@node Administrative Functions @node Administrative Functions
@subsection Administration Functions @subsubsection Administration Functions
This section describes administrative, non-technical GOOPS functions. This section describes administrative, non-technical GOOPS functions.
@ -2428,8 +2339,8 @@ This section describes administrative, non-technical GOOPS functions.
Return the current GOOPS version as a string, for example ``0.2''. Return the current GOOPS version as a string, for example ``0.2''.
@end deffn @end deffn
@node Error Handling @node GOOPS Error Handling
@subsection Error Handling @subsubsection Error Handling
The procedure @code{goops-error} is called to raise an appropriate error The procedure @code{goops-error} is called to raise an appropriate error
by the default methods of the following generic functions: by the default methods of the following generic functions:
@ -2464,7 +2375,7 @@ as done by @code{scm-error}.
@end deffn @end deffn
@node Object Comparisons @node Object Comparisons
@subsection Object Comparisons @subsubsection Object Comparisons
@deffn generic eqv? @deffn generic eqv?
@deffnx method eqv? ((x <top>) (y <top>)) @deffnx method eqv? ((x <top>) (y <top>))
@ -2493,7 +2404,7 @@ and the Guile reference manual.
@end deffn @end deffn
@node Cloning Objects @node Cloning Objects
@subsection Cloning Objects @subsubsection Cloning Objects
@deffn generic shallow-clone @deffn generic shallow-clone
@deffnx method shallow-clone (self <object>) @deffnx method shallow-clone (self <object>)
@ -2514,7 +2425,7 @@ or by reference.
@end deffn @end deffn
@node Write and Display @node Write and Display
@subsection Write and Display @subsubsection Write and Display
@deffn {primitive generic} write object port @deffn {primitive generic} write object port
@deffnx {primitive generic} display object port @deffnx {primitive generic} display object port
@ -2542,8 +2453,8 @@ methods - instances of the class @code{<method>}.
as the Guile primitive @code{write} and @code{display} functions. as the Guile primitive @code{write} and @code{display} functions.
@end deffn @end deffn
@node MOP Specification, Tutorial, Reference Manual, Top @node MOP Specification
@chapter MOP Specification @section MOP Specification
For an introduction to metaobjects and the metaobject protocol, For an introduction to metaobjects and the metaobject protocol,
see @ref{Metaobjects and the Metaobject Protocol}. see @ref{Metaobjects and the Metaobject Protocol}.
@ -2598,7 +2509,7 @@ what the caller expects to get as the applied method's return value.
@end menu @end menu
@node Class Definition @node Class Definition
@section Class Definition @subsection Class Definition
@code{define-class} (syntax) @code{define-class} (syntax)
@ -2731,7 +2642,7 @@ or @code{#:accessor} option.
@end itemize @end itemize
@node Instance Creation @node Instance Creation
@section Instance Creation @subsection Instance Creation
@code{make <class> . @var{initargs}} (method) @code{make <class> . @var{initargs}} (method)
@ -2752,13 +2663,13 @@ return value is ignored.
@end itemize @end itemize
@node Class Redefinition @node Class Redefinition
@section Class Redefinition @subsection Class Redefinition
The default @code{class-redefinition} method, specialized for classes The default @code{class-redefinition} method, specialized for classes
with the default metaclass @code{<class>}, has the following internal with the default metaclass @code{<class>}, has the following internal
protocol. protocol.
@code{class-redefinition @var{(old <class>)} @var{(new <class>)}} @code{class-redefinition (@var{old <class>}) (@var{new <class>})}
(method) (method)
@itemize @bullet @itemize @bullet
@ -2797,7 +2708,7 @@ to the modified instance, and initializes new slots, as described in
generic function invocation that can be used to customize the instance generic function invocation that can be used to customize the instance
update algorithm. update algorithm.
@code{change-class @var{(old-instance <object>)} @var{(new <class>)}} (method) @code{change-class (@var{old-instance <object>}) (@var{new <class>})} (method)
@itemize @bullet @itemize @bullet
@item @item
@ -2814,7 +2725,7 @@ nothing.
@end itemize @end itemize
@node Method Definition @node Method Definition
@section Method Definition @subsection Method Definition
@code{define-method} (syntax) @code{define-method} (syntax)
@ -2842,7 +2753,7 @@ theoretically handle adding methods to further types of target.
@end itemize @end itemize
@node Generic Function Invocation @node Generic Function Invocation
@section Generic Function Invocation @subsection Generic Function Invocation
[ *fixme* Description required here. ] [ *fixme* Description required here. ]
@ -2886,20 +2797,6 @@ theoretically handle adding methods to further types of target.
@code{no-next-method} @code{no-next-method}
@end itemize @end itemize
@node Tutorial, Concept Index, MOP Specification, Top @node Tutorial
@chapter Tutorial @section Tutorial
@include goops-tutorial.texi @include goops-tutorial.texi
@node Concept Index, Function and Variable Index, Tutorial, Top
@unnumberedsec Concept Index
@printindex cp
@node Function and Variable Index, , Concept Index, Top
@unnumberedsec Function and Variable Index
@printindex fn
@summarycontents
@contents
@bye

View file

@ -175,6 +175,8 @@ x
* Guile Modules:: * Guile Modules::
* GOOPS::
* Guile Implementation:: * Guile Implementation::
* Autoconf Support:: * Autoconf Support::
@ -363,6 +365,8 @@ available through both Scheme and C interfaces.
@include scsh.texi @include scsh.texi
@include scheme-debugging.texi @include scheme-debugging.texi
@include goops.texi
@node Guile Implementation @node Guile Implementation
@chapter Guile Implementation @chapter Guile Implementation

View file

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Before After
Before After

View file

@ -28,7 +28,7 @@ datatypes described here.)
@menu @menu
* Describing a New Type:: * Describing a New Type::
* Creating Instances:: * Creating Smob Instances::
* Type checking:: * Type checking::
* Garbage Collecting Smobs:: * Garbage Collecting Smobs::
* Garbage Collecting Simple Smobs:: * Garbage Collecting Simple Smobs::
@ -132,8 +132,8 @@ init_image_type (void)
@end example @end example
@node Creating Instances @node Creating Smob Instances
@subsection Creating Instances @subsection Creating Smob Instances
Normally, smobs can have one @emph{immediate} word of data. This word Normally, smobs can have one @emph{immediate} word of data. This word
stores either a pointer to an additional memory block that holds the stores either a pointer to an additional memory block that holds the

View file

@ -22,7 +22,7 @@ use Guile in many useful and interesting ways.
@node Manual Layout @node Manual Layout
@section Layout of this Manual @section Layout of this Manual
The manual is divided into five chapters. The manual is divided into the following chapters.
@table @strong @table @strong
@item Chapter 1: Introduction to Guile @item Chapter 1: Introduction to Guile
@ -58,6 +58,10 @@ Describes some important modules, distributed as part of the Guile
distribution, that extend the functionality provided by the Guile distribution, that extend the functionality provided by the Guile
Scheme core. Scheme core.
@item Chapter 6: GOOPS
Describes GOOPS, an object oriented extension to Guile that provides
classes, multiple inheritance and generic functions.
@end table @end table
@ -141,6 +145,9 @@ filling out a lot of the documentation of Scheme data types, control
mechanisms and procedures. In addition, he wrote the documentation mechanisms and procedures. In addition, he wrote the documentation
for Guile's SRFI modules and modules associated with the Guile REPL. for Guile's SRFI modules and modules associated with the Guile REPL.
The chapter on GOOPS was written by Christian Lynbech, Mikael
Djurfeldt and Neil Jerram.
@node Guile License @node Guile License
@section The Guile License @section The Guile License
@cindex copying @cindex copying

View file

@ -232,8 +232,8 @@ is a expression suitable for initializing a new variable.
For procedures, you can use @code{SCM_DEFINE} for most purposes. Use For procedures, you can use @code{SCM_DEFINE} for most purposes. Use
@code{SCM_PROC} along with @code{SCM_REGISTER_PROC} when you don't @code{SCM_PROC} along with @code{SCM_REGISTER_PROC} when you don't
want to be bothered with docstrings. Use @code{SCM_GPROC} for generic want to be bothered with docstrings. Use @code{SCM_GPROC} for generic
functions (@pxref{Creating Generic Functions,,, goops, GOOPS}). All functions (@pxref{Creating Generic Functions}). All procedures are
procedures are declared with return type @code{SCM}. declared with return type @code{SCM}.
For everything else, use the appropriate macro (@code{SCM_SYMBOL} for For everything else, use the appropriate macro (@code{SCM_SYMBOL} for
symbols, and so on). Without "_GLOBAL_", the declarations are symbols, and so on). Without "_GLOBAL_", the declarations are