3600 seconds seconds = 0
which means that this is a number of seconds in the hour:min:seconds decomposition Now it looks to me that the method comment is wrong seconds "Answer the number of seconds the receiver represents." ^ (seconds rem: SecondsInMinute) 3600 seconds asSeconds = 3600 is what is working may be (Duration seconds: 3600) would be better To me there is something conceptually bogus with such definition of minutes and seconds. (Duration seconds: 3600) minutes = 0 (Duration seconds: 3600) seconds = 0 Stef _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
On Tue, Aug 24, 2010 at 7:27 AM, Stéphane Ducasse
<[hidden email]> wrote: > 3600 seconds seconds = 0 > which means that this is a number of seconds in the hour:min:seconds decomposition > > Now it looks to me that the method comment is wrong yeap > > seconds > "Answer the number of seconds the receiver represents." > > ^ (seconds rem: SecondsInMinute) > > > 3600 seconds asSeconds = 3600 is what is working > > may be (Duration seconds: 3600) would be better > > To me there is something conceptually bogus with such definition of minutes and seconds. > (Duration seconds: 3600) minutes = 0 > (Duration seconds: 3600) seconds = 0 > that's the same you remarked, the decomposition of the duration :). Maybe there are better names for the decomposition... Or better comments. I'm looking that Duration also lacks methods to get the total hours and minutes the duration represents (Which is the behavior you expected, didn't you?). Something like (Duration seconds: 3600) totalMinutes = 60 (Duration seconds: 3600) totalSeconds = 3600 But, what about something like (Duration seconds: 3601) totalMinutes = (3601/60) ?? Guille > > > Stef > > > _______________________________________________ > Pharo-users mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users > > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
we should check our ugly standard because apparently seconds comes from ANSI.
Stef On Aug 24, 2010, at 12:45 PM, Guillermo Polito wrote: > On Tue, Aug 24, 2010 at 7:27 AM, Stéphane Ducasse > <[hidden email]> wrote: >> 3600 seconds seconds = 0 >> which means that this is a number of seconds in the hour:min:seconds decomposition >> >> Now it looks to me that the method comment is wrong > > yeap > >> >> seconds >> "Answer the number of seconds the receiver represents." >> >> ^ (seconds rem: SecondsInMinute) >> >> >> 3600 seconds asSeconds = 3600 is what is working >> >> may be (Duration seconds: 3600) would be better >> >> To me there is something conceptually bogus with such definition of minutes and seconds. >> (Duration seconds: 3600) minutes = 0 >> (Duration seconds: 3600) seconds = 0 >> > > that's the same you remarked, the decomposition of the duration :). > Maybe there are better names for the decomposition... Or better comments. > > I'm looking that Duration also lacks methods to get the total hours > and minutes the duration represents (Which is the behavior you > expected, didn't you?). Something like > > (Duration seconds: 3600) totalMinutes = 60 > (Duration seconds: 3600) totalSeconds = 3600 > > But, what about something like > > (Duration seconds: 3601) totalMinutes = (3601/60) ?? > > Guille > >> >> >> Stef >> >> >> _______________________________________________ >> Pharo-users mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users >> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
According to the pdf in here http://wiki.squeak.org/squeak/172
Duration may have ... asSeconds Answer the total number of seconds in the length of time represented by the receiver. ... days Answer the number of complete days in the receiver. hours Answer the number of complete hours in the receiver. minutes Answer the number of complete minutes in the receiver. ... seconds Answer the number of seconds in the receiver. So maybe the best thing to do is to correct the comments and extend the api. Should I open a ticket? On Tue, Aug 24, 2010 at 8:27 AM, Stéphane Ducasse <[hidden email]> wrote: > we should check our ugly standard because apparently seconds comes from ANSI. > > Stef > > On Aug 24, 2010, at 12:45 PM, Guillermo Polito wrote: > >> On Tue, Aug 24, 2010 at 7:27 AM, Stéphane Ducasse >> <[hidden email]> wrote: >>> 3600 seconds seconds = 0 >>> which means that this is a number of seconds in the hour:min:seconds decomposition >>> >>> Now it looks to me that the method comment is wrong >> >> yeap >> >>> >>> seconds >>> "Answer the number of seconds the receiver represents." >>> >>> ^ (seconds rem: SecondsInMinute) >>> >>> >>> 3600 seconds asSeconds = 3600 is what is working >>> >>> may be (Duration seconds: 3600) would be better >>> >>> To me there is something conceptually bogus with such definition of minutes and seconds. >>> (Duration seconds: 3600) minutes = 0 >>> (Duration seconds: 3600) seconds = 0 >>> >> >> that's the same you remarked, the decomposition of the duration :). >> Maybe there are better names for the decomposition... Or better comments. >> >> I'm looking that Duration also lacks methods to get the total hours >> and minutes the duration represents (Which is the behavior you >> expected, didn't you?). Something like >> >> (Duration seconds: 3600) totalMinutes = 60 >> (Duration seconds: 3600) totalSeconds = 3600 >> >> But, what about something like >> >> (Duration seconds: 3601) totalMinutes = (3601/60) ?? >> >> Guille >> >>> >>> >>> Stef >>> >>> >>> _______________________________________________ >>> Pharo-users mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users >>> >>> >>> _______________________________________________ >>> Pharo-project mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
yes please!
Thanks for checking. Stef On Aug 24, 2010, at 3:12 PM, Guillermo Polito wrote: > According to the pdf in here http://wiki.squeak.org/squeak/172 > > Duration may have > ... > asSeconds > Answer the total number of seconds in the length of time > represented by the receiver. > ... > days > Answer the number of complete days in the receiver. > hours > Answer the number of complete hours in the receiver. > minutes > Answer the number of complete minutes in the receiver. > ... > seconds > Answer the number of seconds in the receiver. > > So maybe the best thing to do is to correct the comments and extend the api. > > Should I open a ticket? > > On Tue, Aug 24, 2010 at 8:27 AM, Stéphane Ducasse > <[hidden email]> wrote: >> we should check our ugly standard because apparently seconds comes from ANSI. >> >> Stef >> >> On Aug 24, 2010, at 12:45 PM, Guillermo Polito wrote: >> >>> On Tue, Aug 24, 2010 at 7:27 AM, Stéphane Ducasse >>> <[hidden email]> wrote: >>>> 3600 seconds seconds = 0 >>>> which means that this is a number of seconds in the hour:min:seconds decomposition >>>> >>>> Now it looks to me that the method comment is wrong >>> >>> yeap >>> >>>> >>>> seconds >>>> "Answer the number of seconds the receiver represents." >>>> >>>> ^ (seconds rem: SecondsInMinute) >>>> >>>> >>>> 3600 seconds asSeconds = 3600 is what is working >>>> >>>> may be (Duration seconds: 3600) would be better >>>> >>>> To me there is something conceptually bogus with such definition of minutes and seconds. >>>> (Duration seconds: 3600) minutes = 0 >>>> (Duration seconds: 3600) seconds = 0 >>>> >>> >>> that's the same you remarked, the decomposition of the duration :). >>> Maybe there are better names for the decomposition... Or better comments. >>> >>> I'm looking that Duration also lacks methods to get the total hours >>> and minutes the duration represents (Which is the behavior you >>> expected, didn't you?). Something like >>> >>> (Duration seconds: 3600) totalMinutes = 60 >>> (Duration seconds: 3600) totalSeconds = 3600 >>> >>> But, what about something like >>> >>> (Duration seconds: 3601) totalMinutes = (3601/60) ?? >>> >>> Guille >>> >>>> >>>> >>>> Stef >>>> >>>> >>>> _______________________________________________ >>>> Pharo-users mailing list >>>> [hidden email] >>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users >>>> >>>> >>>> _______________________________________________ >>>> Pharo-project mailing list >>>> [hidden email] >>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>> >>> >>> _______________________________________________ >>> Pharo-project mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
http://code.google.com/p/pharo/issues/detail?id=2855
On Tue, Aug 24, 2010 at 10:20 AM, Stéphane Ducasse <[hidden email]> wrote: yes please! _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
What about the fractional part ?
Should asSeconds and seconds answer an integral truncated number, or should it answer the fractional subSeconds part (a ScaledDecimal ? aFloat ?) Nicolas 2010/8/24 Guillermo Polito <[hidden email]>: > http://code.google.com/p/pharo/issues/detail?id=2855 > > On Tue, Aug 24, 2010 at 10:20 AM, Stéphane Ducasse > <[hidden email]> wrote: >> >> yes please! >> Thanks for checking. >> >> Stef >> On Aug 24, 2010, at 3:12 PM, Guillermo Polito wrote: >> >> > According to the pdf in here http://wiki.squeak.org/squeak/172 >> > >> > Duration may have >> > ... >> > asSeconds >> > Answer the total number of seconds in the length of time >> > represented by the receiver. >> > ... >> > days >> > Answer the number of complete days in the receiver. >> > hours >> > Answer the number of complete hours in the receiver. >> > minutes >> > Answer the number of complete minutes in the receiver. >> > ... >> > seconds >> > Answer the number of seconds in the receiver. >> > >> > So maybe the best thing to do is to correct the comments and extend the >> > api. >> > >> > Should I open a ticket? >> > >> > On Tue, Aug 24, 2010 at 8:27 AM, Stéphane Ducasse >> > <[hidden email]> wrote: >> >> we should check our ugly standard because apparently seconds comes from >> >> ANSI. >> >> >> >> Stef >> >> >> >> On Aug 24, 2010, at 12:45 PM, Guillermo Polito wrote: >> >> >> >>> On Tue, Aug 24, 2010 at 7:27 AM, Stéphane Ducasse >> >>> <[hidden email]> wrote: >> >>>> 3600 seconds seconds = 0 >> >>>> which means that this is a number of seconds in the >> >>>> hour:min:seconds decomposition >> >>>> >> >>>> Now it looks to me that the method comment is wrong >> >>> >> >>> yeap >> >>> >> >>>> >> >>>> seconds >> >>>> "Answer the number of seconds the receiver represents." >> >>>> >> >>>> ^ (seconds rem: SecondsInMinute) >> >>>> >> >>>> >> >>>> 3600 seconds asSeconds = 3600 is what is working >> >>>> >> >>>> may be (Duration seconds: 3600) would be better >> >>>> >> >>>> To me there is something conceptually bogus with such definition of >> >>>> minutes and seconds. >> >>>> (Duration seconds: 3600) minutes = 0 >> >>>> (Duration seconds: 3600) seconds = 0 >> >>>> >> >>> >> >>> that's the same you remarked, the decomposition of the duration :). >> >>> Maybe there are better names for the decomposition... Or better >> >>> comments. >> >>> >> >>> I'm looking that Duration also lacks methods to get the total hours >> >>> and minutes the duration represents (Which is the behavior you >> >>> expected, didn't you?). Something like >> >>> >> >>> (Duration seconds: 3600) totalMinutes = 60 >> >>> (Duration seconds: 3600) totalSeconds = 3600 >> >>> >> >>> But, what about something like >> >>> >> >>> (Duration seconds: 3601) totalMinutes = (3601/60) ?? >> >>> >> >>> Guille >> >>> >> >>>> >> >>>> >> >>>> Stef >> >>>> >> >>>> >> >>>> _______________________________________________ >> >>>> Pharo-users mailing list >> >>>> [hidden email] >> >>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users >> >>>> >> >>>> >> >>>> _______________________________________________ >> >>>> Pharo-project mailing list >> >>>> [hidden email] >> >>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >>>> >> >>> >> >>> _______________________________________________ >> >>> Pharo-project mailing list >> >>> [hidden email] >> >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> >> >> >> _______________________________________________ >> >> Pharo-project mailing list >> >> [hidden email] >> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> > >> > _______________________________________________ >> > Pharo-project mailing list >> > [hidden email] >> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Free forum by Nabble | Edit this page |