[plt-scheme] inner

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Sep 27 17:27:18 EDT 2004

At Mon, 27 Sep 2004 17:19:38 -0400, "Mike T. Machenry" wrote:
> Is it not possible to call the inner augmentation of a method from within a 
> another method of the class?

Yes, it's possible.

 > (define c% (class object% 
                (define/pubment (m) (inner 10 m))
 > (send (new c%) m)
 > (define d% (class c% 
                (define/augment (m) (n)) 
                (define/public (n) (inner 12 m))
 > (send (new d%) m)
 > (send (new d%) n)
 > (define e% (class d%
                (define/augment (m) 14)
 > (send (new e%) n)

If you don't declare the relevant method using `augment' or `pubment'
within the calling class, you'll have to use `rename-inner' instead of
`inner'. I haven't yet seen a case where that's useful, though.


Posted on the users mailing list.