[plt-scheme] cannot serialize classes with private methods

From: Jon Rafkind (workmin at ccs.neu.edu)
Date: Sun Aug 6 01:21:21 EDT 2006


> When you leave out `public', you don't get a private method. Instead,
> you get a procedure-valued field.
>
>   
Sorry I misspoke, I tend to use private and, as you call them,
procedure-valued fields interchangeably since I didn't see any real
differences in them from the manual. Are there any other subtle
differences between them?
> If you add a `(private foo)' declaration to your class, then `foo' is a
> private method, and instances of the class `foo' are serializable.
>
>   
Ok, that works.
> The difference between a private method and an procedure-valued field
> is subtle, and the current syntax of `class' makes the difference too
> subtle. The solution isn't obvious, because we want to support macros
> in a `class' body that expand to definitions, and it's not clear
> whether function definitions from a macro expansion should be treated
> automatically as methods.
>
>   
I probably don't have a strong enough grasp over this stuff but wouldn't
procedure-valued fields always not be treated as methods? If not, could
they be automatically wrapped with a (private) ?


Posted on the users mailing list.