[plt-scheme] levels of access to object fields
At Thu, 18 Jan 2007 08:54:10 -0500, Prabhakar Ragde wrote:
> Matthew Flatt wrote:
> > At Thu, 18 Jan 2007 06:33:49 -0500, Prabhakar Ragde wrote:
> >> Is it possible to make a field of an object that is accessible to
> >> objects of the same class but otherwise private?
> >
> > Use `define-local-member-name':
>
> So is it idiomatic to do this every time I want to implement some binary
> operation on two objects of the same class (say, some sort of loose
> equality or comparison) while preserving information-hiding?
That's what I do. But `define-local-member-name' usually ends up at a
module top level, because I'm usually only interested in hiding
information from outside the module.
Matthew