Problem with Time>asSeconds

8 messages
Open this post in threaded view
|

Problem with Time>asSeconds

Open this post in threaded view
|

Re: Problem with Time>asSeconds

 No expert here but philosophically I agree it should truncate not round. -- You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/2tES0ceF3ssJ. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Open this post in threaded view
|

Aw: Re: Problem with Time>asSeconds

 Please remember, that this message is now nearly 10 year old - with this source code .... and I get the feeling, that using the method in the way Louis did in 5.5.2 is not ok. Actually I'm very surprised, that an algorithm fails because of this change - this does not seem to be a stable algorithm for me. -- You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/1Tk76SGwk4cJ. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Open this post in threaded view
|

Re: Problem with Time>asSeconds

 In reply to this post by Louis LaBrunda Lou -Can you explain a bit more about why your algorithm fails? Philisophically I agree with Wayne -- I would expect to get the same answer from asSeconds as I would get from hours * 60 + minutes * 60 + seconds. However, given the age of the method and the stability issues we have had in the past with our various time-related classes, I am reluctant to make a change without a strong rationale.John -- You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/kNkHsBYvHBcJ. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Open this post in threaded view
|

Re: Problem with Time>asSeconds

Open this post in threaded view
|

Re: Problem with Time>asSeconds

 Hi Louis, if you are still in the mood for browsing through your code and eventual drawbacks due to your update, I would like to point you on one little change that I had similar problems with. The method Number>>#abtAsInteger changed from down to up rounding. It's is also in the documentation but you never know if someone in the past hacked around it, or hacks might rely on this. Especially when you have general coding handling "Number"s. Check this out: (Number fromString: '0.7') abtAsInteger and loadthe different versions of abtAsInteger: NEW: abtAsInteger         "Answer an integer which is nearest to the receiver."                 ^self rounded OLD: abtAsInteger         ^self truncated Even if this is a documented change it is sometimes hard to find those,.. especially when it comes to XML and other file processings... Have fun ;-) Sebastian