Paul - this is very helpful, gosh you learn a lot from what seemed like simple 
question.

Your suggestion along with Subbu’s gives an easy workable solution - I also 
wonder if the method should be in the image along with the comment explaining 
half open intervals like you have. Do you think there is another name for that 
end method - displayEnd sounds like it actively displays - I wonder if 
boundedEnd or completeEnd or finiteEnd might be correct alternatives (or is 
displayEnd a decent convention that everyone understands?)

I really have to learn how to submit pull requests (although it seems rather 
complicated at the moment while the full git integration process is being 
sorted out).

Thanks everyone

Tim

> On 21 Jul 2017, at 16:40, Paul DeBruicker <pdebr...@gmail.com> wrote:
> 
> Tim Mackinnon wrote
>> I am also wondering if the issue with Timespan is concerning - I was
>> surprised that putting a start and end date left me something that didn’t
>> answer my end date presumably down to rounding when it’s converted down to
>> a duration (making me wonder if its better to keep a start and end date
>> and calculate the duration on the fly).
>> 
>> Tim
> 
> 
> The Timespans are half open intervals.
> (https://en.wikipedia.org/wiki/Interval_(mathematics))
> 
> Friday July 21st ends at 11:59:59.99999999999... etc etc etc ...9999PM and
> the 22nd starts at 12:00AM
> 
> 
> If Timespans were closed intervals like you expect then we'd be out of whack
> with our corner of the universe.  That extra clock tick adds complexity.  
> 
> But I add a method to my image called #displayEnd because I also want them
> to print 3PM-4PM and not 3PM-3:59:59.999999999PM and use that in my print
> statements and rendering for Seaside.  
> 
> displayEnd
>       ^ start + duration
> 
> 
> 
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://forum.world.st/How-to-calculate-someone-s-age-elegantly-Does-Duration-work-tp4955990p4956114.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 


Reply via email to