Hi, there are some weird things around the data & time API. So time-related classes are using methods like #asNanoSeconds. And numbers do not implements it. But they do implement methods as #nanoSeconds, #milliSeconds, #seconds and #asSeconds. Of course "5 nanoSecondsâ are nicer than â5 asNanoSecondsâ. Maybe we can do something to maintain polymorphism? Uko
Uko2 wrote
"5 nanoSecondsâ are nicer than â5 asNanoSecondsâ
And "5 nanoseconds" would be even nicer ;) http://forum.world.st/milliseconds-versus-milliSeconds-tt4809142.html ----- Cheers, Sean -- View this message in context: http://forum.world.st/Date-Time-api-tp4843669p4843805.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
To, #asNanoSeconds converts the time into the umber of nanosecond that the time represents. #nanoSeconds (and the others) create a duration that is to be added to the time or DateAndTime. The two do not end with the same things 0 and shouldin't. The first tells you how many they represent; the second builds duration. Probably not ideal names - but the intents are definitely different. -cbc On Tue, Aug 18, 2015 at 1:21 AM, Yuriy Tymchuk <yuriy.tymchuk@me.com> wrote:
Hi,
there are some weird things around the data & time API. So time-related classes are using methods like #asNanoSeconds. And numbers do not implements it. But they do implement methods as #nanoSeconds, #milliSeconds, #seconds and #asSeconds. Of course "5 nanoSecondsâ are nicer than â5 asNanoSecondsâ. Maybe we can do something to maintain polymorphism?
Uko
participants (3)
-
Chris Cunningham -
Sean P. DeNigris -
Yuriy Tymchuk