YASOS ported to R7RS

Jason K. MacDuffie d9d8bab124 do not use format 5 years ago
.gitignore 924ab5a5fb Begin work on documentation 5 years ago
LICENSE 59e36de302 init commit 5 years ago
Makefile 924ab5a5fb Begin work on documentation 5 years ago
README.md 1dfa2993c5 allow variadic generics 5 years ago
yasos.scrbl 924ab5a5fb Begin work on documentation 5 years ago
yasos.sld d9d8bab124 do not use format 5 years ago

README.md

YASOS: Yet Another Scheme Object System

NOTES: An object system for Scheme based on the paper by Norman Adams and Jonathan Rees: "Object Oriented Programming in Scheme", Proceedings of the 1988 ACM Conference on LISP and Functional Programming, July 1988 [ACM #552880].

Interface

(define-operation (opname self arg ...) default-body)

(define-predicate opname)

(object ((name self arg ...) body) ... )

(object-with-ancestors ( (ancestor1 init1) ...) operation ...)

;; in an operation {a.k.a. send-to-super}
(operate-as component operation self arg ...)

Example usage

> (import (yasos))
> (define-predicate instance?)
> (define-operation (instance-dispatcher obj)
    0)
> (define (make-instance dispatcher)
    (object
     ((instance? self) #t)
     ((instance-dispatcher self) dispatcher)))
> (define x (make-instance 100))
> (instance? x)
#t
> (instance-dispatcher x)
100
> (instance? "Not an instance")
#f
> (instance-dispatcher "Not an instance")
0

Original program by Kenneth Dickey. Improvements made by Juergen Lorenz. Ported to R7RS by Jason K. MacDuffie.

LICENSE: MIT (Expat) license. See LICENSE for details.