goops


The Guile Object Oriented Programming System (GOOPS) is an extension to the Guile Scheme implementation that adds object oriented programming capabilities.

While there is a home page, GOOPS is distributed and installed along with the Guile core distribution.

Its implementation is derived from STk-3.99.3 by Erick Gallesio and version 1.3 of Gregor Kiczales Tiny-Clos. It is designed in the spirit of tiny-clos, CLOS and stklos. It has multiple inheritance, generic functions with multi-method dispatch and a meta-object-protocol in the spirit of CLOS.


Here is a simple example of: class definition, method definition, class instantiation and method invocation.

 (define-module (example) 
   #:use-module (oop goops) 
   #:duplicates merge-generics) 
  
 (define-class <spiffy> () 
   (a #:accessor value)) 
  
 (define-method (do-something-with (o <spiffy>)) 
   (format #t "the value of the slot 'a' is ~A~%" (value o))) 
  
 (define o (make <spiffy>)) 
 (set! (value o) 123) 
 (do-something-with o) 

category-object-oriented|category-implementations|category-software|category-goops