[plt-scheme] same names for class.ss init-fields and methods
At Wed, 26 Mar 2003 10:09:59 -0500, "Neil W. Van Dyke" wrote:
> In `class*' syntax, is there a way to define public methods that have
> the same names as initialization fields?
Yes. The init var and method must have different internal names,
though.
Generally, replace a single name with `(internal-name external-name)'
to make the internal and external names different.
(class object%
(init ((local-foo foo) 17))
; ^ ^ ^--- default value
; | `---- external name
; internal name
...)
Matthew