7 Classes and Objects
(require (planet cce/scheme:7:8/class)) |
This module provides tools for classes, objects, and mixins.
7.1 Predicates and Contracts
Recognizes classes and interfaces.
(object-provides/c spec ...) → flat-contract? spec : class-or-interface/c
Recognizes objects which are instances of all the given classes and interfaces.
(class-provides/c spec ...) → flat-contract? spec : class-or-interface/c
Recognizes classes which are subclasses (not strictly) and implementations,
respectively, of all the given classes and interfaces.
(mixin-provides/c [super-expr ...] [sub-expr ...])
Function contract for a mixin whose argument is the parent class c%
matching (class-provides/c super-expr ...) and whose result matches
(class-provides/c c% sub-expr ...).
7.2 Mixins
(ensure-interface i<%> mx c%) → (class-provides/c c% i<%>) i<%> : interface? mx : (mixin-provides/c [] [i<%>]) c% : class?
Returns c% if it implements i<%>; otherwise, returns
(mx c%).
7.3 Methods
(send+ obj [message arg ...] ...)
Sends each message (with arguments) to obj, then returns obj.
Examples: | |||||||||||
|
(send-each objs message arg ...)
Examples: | |||||||||||||||
|