[plt-scheme] can't find class class%

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Mar 18 16:52:11 EST 2005

At Thu, 17 Mar 2005 16:53:41 -0600, Corey Sweeney wrote:
> But I can't find the class class% in the system or in the docs.  I
> know the mzscheme OOP does not implement the full MOP, Is this one of
> the MOP features that was decided against in the mzscheme OOP?

I don't think that MzScheme implements any sort of MOP. There's
certainly no `class%'.

(There is a `snip-class%', but that's used only for marshaling snips to
streams, and it exists only because we didn't have general
serialization support.)

If I understand the goal, I think you could implement `bean-class%' as a mixin:

 (define bean-class%
  (class object%
    (init-field (bean-xpm ""))
    (public bean-image)
    (define-values (bean-image) (lambda (xpm) (set! bean-xpm xpm)))
    (init-field (bean-description-var ""))
    (public bean-description)
    (define-values (set-bean-description!)
      (lambda (desc) (set! bean-desecription-var desc)))
    (init-field (bean-snip-var (lambda () void)))
    (public bean-snip)
    (define-values (bean-snip) (lambda (snip) (set! bean-snip-var snip)))))

 (define (make-bean-class bean-class%-instance %)
   (class %
    (define/public (get-class) bean-class%-instance)


Posted on the users mailing list.