[squeak-dev] Why don't McmWriter/Reader save/load the name?

David T. Lewis lewis at mail.msen.com
Tue Oct 8 04:57:53 UTC 2013


On Mon, Oct 07, 2013 at 09:21:48PM -0500, Chris Muller wrote:
> Why isn't serialization for MCConfiguration's include the name?
> 
> "Inspect.  Why is 2nd-elements name misisng?"
> MCConfiguration allInstances anyOne in:
>      [ : config |
>      { config.
>      (MCMcmReader on:
>           (String streamContents:
>                [ : stream | config fileOutOn: stream ]) readStream) version } ]
> 
> This is unexpected behavior..

Just guessing but maybe:

Because an MC configuration is stored in a named file (stream), and
an anonymous stream does not have a name.

If you chose to serialize the name and store it in the file, you would
then have the problem of what to do if the file name did not match the
expected name, or what to do if you wanted to rename the file in which
the configuration had been stored. That is certainly a solveable problem,
but there is something to be said for keeping things simple.

Dave



More information about the Squeak-dev mailing list