Date readFromString: Date today storeString
raises an exception...
testReadFrom works so it is the idiom readFrom:/storeOn: that does not work anymore?
Stef
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@lists.squeakfoundation.org [mailto:squeak-dev-bounces@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
Looking at it, the readFromString: expects a String and not a date, so
Date readFromString: Date today asString
works.
As does
Compiler evaluate: Date today storeString
-----Original Message----- From: squeak-dev-bounces@lists.squeakfoundation.org [mailto:squeak-dev-bounces@lists.squeakfoundation.org]On Behalf Of stephane ducasse Sent: 29 May 2006 10: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
squeak-dev@lists.squeakfoundation.org