[racket] protected (semi-private) fields

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Fri Jun 3 14:56:54 EDT 2011

See the documentation for define-local-member-name:

Rather than always limiting a "protected" member to a class and its
subclasses, we allow limiting them by lexical scope.  That way you can
decide precisely what classes can and can't use it based on where you
put the define-local-member-name.

Carl Eastlund

On Wed, Jun 1, 2011 at 3:40 PM, Razvan Rotaru <roti_343 at yahoo.com> wrote:
> Hi,
> Question about classes in Racket: can I make fields which can be inherited
> by super-classes, but not accessible from outside the class? (like
> "protected" members in Java)
> As I understand field and init-field declarations produce public fields
> (which can be accessed from outside the class), and define produces private
> fields (which can't be inherited).
> Razvan

Posted on the users mailing list.