randy at Eng.Sun.COM
Thu Apr 11 20:31:43 UTC 1991
Back when we were doing the original design, we called this the "corruption of prototypes" problem. I've corrupted a prototype or two myself.
One sort of environmental solution (which we did not like) was to have some parent of the lobby full of slots like "paragraphCopy," and "pointCopy." Of course these slots contain simple methods that return a copy of the associated prototype. The prototypes themselves would be harder to reach (e.g.: "lobby prototypes text paragraph," or "lobby protoypes geometry point," so people would be protected from a typographic fluke unintentionally yielding a prototype, which could then get unintentionally corrupted.) Yet each prototype would still be available for inspection and modification in the same fundamental way as any object.
I guess I favor considering cures of the environmental sort...they stand a good chance of virtually eliminating the problem in practice, without really changing the semantics.
Your letter suggests to me that the object "prototypes" should be a NON-parent slot of the lobby, and should be called "THE." That way our code would be full of strangely appropriate prose that would help remind the programmer of the seriousness of the reference, e.g.:
border: THE rectangle copy.
More information about the Self-interest