[plt-scheme] Accessing class in method?
Ok, I'm not sure how clearly I can word this... I'm trying to write a
method that creates an instance of the class that it is a method on, and
I'm not sure how to go about it. Here's an example:
> (define a%
(class object%
(super-new)
(define/public (make)
(make-object a%))))
> (make-object a%)
#(struct:object:a% ...)
> (send (make-object a%) make)
#(struct:object:a% ...)
So far so good.
> (define b%
(class a% (super-new)))
> (make-object b%)
#(struct:object:b% ...)
> (send (make-object b%) make)
#(struct:object:a% ...)
What I want is a way for calling "make" on b% to return an instance of
b% not of a%.
Cheers,
Sam