Date readFromString: Date today storeString....is it a bug?

Alan Lovejoy squeak-dev.sourcery at forum-mail.net
Mon May 29 17:29:18 UTC 2006


Steph,

There is no convention that establishes a global invariant with respect to
the relationship between ("y := x printString" | "y := x storeString") and
"x class readFromString: y."  There is, however, a convention that
establishes a global invariant such that "y := x storeString" should be
reversible using "Compiler evaluate: y."

Many Smalltalk class libraries provide an implementation of #printString and
#storeString in Object that both produce the same result, and also implement
Object class>>readFromString: using "Compiler evaluate:". Consequently, "x
class readFromString: x storeString" may or may not evaluate to "x."

"Date readFromString: Date today storeString" produces an exception in
VisualWorks also. I would suggest that you try "Date readFromString: Date
today printString" instead.

--Alan

-----Original Message-----
From: squeak-dev-bounces at lists.squeakfoundation.org
[mailto:squeak-dev-bounces at lists.squeakfoundation.org] On Behalf Of stéphane
ducasse
Sent: Monday, May 29, 2006 2:31 AM
To: The general-purpose Squeak developers list
Subject: Date readFromString: Date today storeString....is it a bug?

Date readFromString: Date today storeString

raises an exception...


testReadFrom works so it is the idiom readFrom:/storeOn: that does not work
anymore?

Stef





More information about the Squeak-dev mailing list