Manuscript (Case [Issue]21569) Kernel - DateAndTime should not use respondsTo logic in minus operation

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

Manuscript (Case [Issue]21569) Kernel - DateAndTime should not use respondsTo logic in minus operation

Pharo Issue Tracker
Manuscript Notification
avatar
Denis Kudryashov opened Case 21569: DateAndTime should not use respondsTo logic in minus operation and assigned it to Everyone:
Cleanup in Project:  Kernel: 1. Pharo Image  •  You are subscribed to this case
This is ugly logic:
<code>
DateAndTime>>- operand
"operand conforms to protocol DateAndTime or protocol Duration"

^ (operand respondsTo: #asDateAndTime)
ifTrue: [
| other |
other := operand asDateAndTime.
Duration
seconds: (SecondsInDay * (julianDayNumber - other julianDayNumberUTC))
+ (seconds - other secondsSinceMidnightUTC)
nanoSeconds: nanos - other nanoSecond ]
ifFalse: [ self + operand negated ]
</code>
We should just use double dispatch.
Priority Priority: 5 – Fix If Time Status Status: Work Needed
Assigned To Assigned to: Everyone Milestone Milestone: Pharo7.0

Go to Case
No longer need updates? Unsubscribe from this case.

Don't want Manuscript notifications anymore? Update your preferences.

Manuscript

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