[squeak-dev] #printOn: as serialization format ... ;-)

Marcel Taeumel marcel.taeumel at hpi.de
Tue Sep 17 16:10:53 UTC 2019


On second thought, #storeOn: and #readFrom: seem not *that* closely related ... Then, there is Object >> #readFromString:. And there are several implementations of #storeOn: that make use of #printOn: ...

> IMHO if a "constructor expression" for the printed object is concise and legible enough, it makes a fine print string. Why not?

Sure, using #storeOn: in #printOn: implementation seems fine. But the other way around? #printOn: is for the human eye, right? #storeOn: is for the machine ...

Best,
Marcel
Am 17.09.2019 17:50:21 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
There is no #readFromPrintString: to cope with changes... So, de-serialization code can be everywhere... 

Best,
Marcel
Am 17.09.2019 17:27:58 schrieb Jakob Reschke <forums.jakob at resfarm.de>:
My youth experience in Lisp (and no, I'm not that old) tells me, sure the printed strings should be readable/evualuable expressions if possible. ;-)

IMHO if a "constructor expression" for the printed object is concise and legible enough, it makes a fine print string. Why not?

In the example you showed, we can discuss about coupling though. This implementation depends on the stability and parseability of the print string implementation of other objects...


Marcel Taeumel <marcel.taeumel at hpi.de [mailto:marcel.taeumel at hpi.de]> schrieb am Di., 17. Sep. 2019, 16:44:

I don't think that's a good idea. We have #storeOn: and #readFrom: for that, right?

Thoughts? :-) Do you know of similar examples?

Best,
Marcel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190917/8671732b/attachment.html>


More information about the Squeak-dev mailing list