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 <guillermopolito@gmail.com>:
http://code.google.com/p/pharo/issues/detail?id=2855
On Tue, Aug 24, 2010 at 10:20 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> 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 <stephane.ducasse@inria.fr> 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 <stephane.ducasse@inria.fr> 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 Pharo-users@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project