FogBugz (Case [Issue]10425) Kernel - DateAndTime refactoring

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FogBugz (Case [Issue]10425) Kernel - DateAndTime refactoring

Pharo Issue Tracker
A FogBugz case was edited by Nicolas Cellier.

Case ID:      10425
Title:        DateAndTime refactoring
Status:       Work Needed
Category:     Bug
Project:      Kernel
Area:         Misc
Priority:     6 - Fix If Time
Milestone:    Later
Assigned To:  Everyone

URL:          https://pharo.fogbugz.com/default.asp?10425


Changes:
Milestone changed from 'Undecided' to 'Later'.

To follow up my mail on Pharo-dev:
http://forum.world.st/Trying-to-understand-DateAndTime-tp4683997.html

Here is what I did to Time:
- added access to primitive 240 (microseconds ellapsed since Squeak Epoch UTC) and method #microsecondClockValue
- added microsecondsToRun: microsecondsSince:
- used this new primitive in place of primSecondsClock (137)
- fixed dateAndTimeNow and dateAndTimeFromSeconds:
- fixed/simplified now

Here is what I did to DateAndTime:
- simplified now -- WARNING: it is not rounded to whole second
- simplified totalSeconds (localOffset not needed anymore with new Time)
- removed horrible milliSecondsSinceMidnight todayAtMilliSeconds: and todayAtNanoSeconds:
- deprecated secondsSinceMidnight replaced by secondsSinceMidnightUTC
- replaced some usage of localSeconds by secondsSinceMidnightLocalTime (the former is not normalized, the later is between 0 and 86399)
- simplified the usage of % (I don't think we need yet another remainder/modulo operator - beside the one of C is more like rem: )
- normalized all instances of DateAndTime at creation time (setJdn:seconds:nano:offset:) and always used this method (impacts Fuel)
- corrected hasEqualTicks: and used it for a faster =
- corrected asTime and asDuraiton (don't use not normalized localSeconds)
- corrected < to use julianDayNumberUTC
- corrected hash (don't use offset in hash)
- removed normalize:ticks:base: since it has side effects (modify the ticks argument)  and since it does not gain speed (I will later use new primitives for accelerating \\ and rem: like in Squeak).

You now understand that I don't wish to scan all opened DateAndTime bugs, it's more efficient to apply this refactoring as a whole.

If you feel like decomposing the actions, it's up to you, but please be fast, these bugs are upsetting.

SLICE in the inbox


Vous êtes abonné(e) à ce dossier. Si vous ne souhaitez plus recevoir de notifications automatiques à l'avenir, désabonnez-vous (https://pharo.fogbugz.com/default.asp?pre=preUnsubscribe&pg=pgEditBug&command=view&ixBug=10425) de ce dossier.

_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker