This file documents GOOPS, an object oriented extension for Guile.

Copyright (C) 1999 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.

Introduction
============

GOOPS is the object oriented extention to Guile. Its implementation is derived from STk-3.99.3 by Erick Gallesio and version 1.3 of Gregor Kickzales Tiny-Clos.  It is very close in spirit to CLOS, the Common Lisp Object System (CLtL2) but is adapted for the Scheme language.  While GOOPS is not compatible with any of these systems, GOOPS contains a compatibility module which allows for execution of STKlos programs.

Briefly stated, the GOOPS extension gives the user a full object oriented system with multiple inheritance and generic functions with multi-method dispatch.  Furthermore, the implementation relies on a true meta object protocol, in the spirit of the one defined for CLOS (Gregor Kiczales: A Metaobject Protocol).

Getting Started
===============

Running GOOPS
-------------

 1. Type

          guile-oops

     You should now be at the Guile prompt ("guile> ").

 2. Type

          (use-modules (oop goops))

     to load GOOPS.  (If your system supports dynamic loading, you should be able to do this not only from `guile-oops' but from an arbitrary Guile interpreter.)

We're now ready to try some basic GOOPS functionality.

Methods
-------

     (define-method + ((x <string>) (y <string>))
       (string-append x y))

     (+ 1 2) --> 3
     (+ "abc" "de") --> "abcde"

User-defined types
------------------

     (define-class <2D-vector> ()
       (x #:init-value 0 #:accessor x-component #:init-keyword #:x)
       (y #:init-value 0 #:accessor y-component #:init-keyword #:y))

     (use-modules (ice-9 format))

     (define-method write ((obj <2D-vector>) port)
       (display (format #f "<~S, ~S>" (x-component obj) (y-component obj))
                port))

     (define v (make <2D-vector> #:x 3 #:y 4))

     v --> <3, 4>

     (define-method + ((x <2D-vector>) (y <2D-vector>))
       (make <2D-vector>
             #:x (+ (x-component x) (x-component y))
             #:y (+ (y-component x) (y-component y))))

     (+ v v) --> <6, 8>

Types
-----

     (class-of v) --> #<<class> <2D-vector> 40241ac0>
     <2D-vector>  --> #<<class> <2D-vector> 40241ac0>
     (class-of 1) --> #<<class> <integer> 401b2a98>
     <integer>    --> #<<class> <integer> 401b2a98>

     (is-a? v <2D-vector>) --> #t

Reference Manual
****************

[TO BE WRITTEN]

MOP specification
*****************

[TO BE WRITTEN]

Tutorial
********

     [file goops-tutorial.texi not included]

Index
*****