mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Improve GOOPS `Quick Start' doc
* doc/ref/goops.texi (Quick Start): Remove words that only reiterate "quick start". * doc/ref/goops.texi (Methods, User-defined classes, Asking for the class of an object): Say "class" instead of "type". They are called classes elsewhere, and in an object-oriented system, people expect classes!
This commit is contained in:
parent
b65ff721a6
commit
de69bd28e3
1 changed files with 9 additions and 11 deletions
|
@ -59,9 +59,6 @@ permission.
|
||||||
@node Quick Start
|
@node Quick Start
|
||||||
@section Quick Start
|
@section Quick Start
|
||||||
|
|
||||||
To give an immediate flavour of what GOOPS can do, here is a very
|
|
||||||
brief introduction to its main operations.
|
|
||||||
|
|
||||||
To start using GOOPS, load the @code{(oop goops)} module:
|
To start using GOOPS, load the @code{(oop goops)} module:
|
||||||
|
|
||||||
@lisp
|
@lisp
|
||||||
|
@ -72,15 +69,16 @@ We're now ready to try some basic GOOPS functionality.
|
||||||
|
|
||||||
@menu
|
@menu
|
||||||
* Methods::
|
* Methods::
|
||||||
* User-defined types::
|
* User-defined classes::
|
||||||
* Asking for the type of an object::
|
* Asking for the class of an object::
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
|
|
||||||
@node Methods
|
@node Methods
|
||||||
@subsection Methods
|
@subsection Methods
|
||||||
|
|
||||||
A GOOPS method is like a Scheme procedure except that it is
|
A GOOPS method is like a Scheme procedure except that it is
|
||||||
specialized for a particular set of argument types.
|
specialized for a particular set of argument classes.
|
||||||
|
|
||||||
@lisp
|
@lisp
|
||||||
(define-method (+ (x <string>) (y <string>))
|
(define-method (+ (x <string>) (y <string>))
|
||||||
|
@ -90,15 +88,15 @@ specialized for a particular set of argument types.
|
||||||
@end lisp
|
@end lisp
|
||||||
|
|
||||||
If @code{+} is used with arguments that do not match the method's
|
If @code{+} is used with arguments that do not match the method's
|
||||||
types, Guile falls back to using the normal Scheme @code{+} procedure.
|
classes, Guile falls back to using the normal Scheme @code{+} procedure.
|
||||||
|
|
||||||
@lisp
|
@lisp
|
||||||
(+ 1 2) @result{} 3
|
(+ 1 2) @result{} 3
|
||||||
@end lisp
|
@end lisp
|
||||||
|
|
||||||
|
|
||||||
@node User-defined types
|
@node User-defined classes
|
||||||
@subsection User-defined types
|
@subsection User-defined classes
|
||||||
|
|
||||||
@lisp
|
@lisp
|
||||||
(define-class <2D-vector> ()
|
(define-class <2D-vector> ()
|
||||||
|
@ -126,8 +124,8 @@ v @result{} <3, 4>
|
||||||
@end group
|
@end group
|
||||||
@end lisp
|
@end lisp
|
||||||
|
|
||||||
@node Asking for the type of an object
|
@node Asking for the class of an object
|
||||||
@subsection Types
|
@subsection Classes
|
||||||
|
|
||||||
@example
|
@example
|
||||||
(class-of v) @result{} #<<class> <2D-vector> 40241ac0>
|
(class-of v) @result{} #<<class> <2D-vector> 40241ac0>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue