On 17 March 2010 13:13, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> wrote:
2010/3/17 stephane ducasse <stephane.ducasse@free.fr>:
in Squeak
    (aDateAndTime offset: '0:12:00:00') =  '1901-01-01T00:00:00+12:00'     true
in pharo
    (aDateAndTime offset: '0:12:00:00') =  '1901-01-01T00:00:00+12:00'.     false.
Apparently the false in pharo comes from a bug in readFrom: in DateAndTime
Now the question is does it make sense to have a DateAndTime = to its string representation. For me I would prefer not
    (aDateAndTime offset: '0:12:00:00') =  '1901-01-01T00:00:00+12:00'     -> false     (aDateAndTime offset: '0:12:00:00') printString  =  '1901-01-01T00:00:00+12:00'     -> true
DateAndTime>>= comparand     "comparand conforms to protocol DateAndTime,     or can be converted into something that conforms."     | comparandAsDateAndTime |     self == comparand         ifTrue: [^ true].     comparandAsDateAndTime := [comparand asDateAndTime]         on: MessageNotUnderstood         do: [^ false].     ^ self offset = comparandAsDateAndTime offset         ifTrue: [self hasEqualTicks: comparandAsDateAndTime ]         ifFalse: [self asUTC ticks = comparandAsDateAndTime asUTC ticks]
What do you think
I would expect = to be "reflexive" Â Â Â self assert: (a = a). "symmetric" Â self assert: (a = b) ==> (b = a). "transitive" Â Â Â self assert: (a = b) & (b = c) ==> (a = c).
yeah, as a Magnitude it should have such properties.
Date>>= does not seem to meet my expectations
Stef _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.