On Tue, Jul 05, 2005 at 04:39:48PM +0300, Gaal Yahas wrote: : As for the function signatures: : : multi sub localtime(Rat $?when = time) returns Time::Local { ... } : multi sub localtime(Int $sec, Int ?$pico = 0) returns Time::Local {...} : : The first form uses the second, but might be less precise.
I don't think either of those are good human engineering. I would like the preferred Perl 6 form to simply be: multi sub localtime(Num $?when = time) returns Time::Local { ... } The time function always returns the time in floating point. In fact, all numeric times are Num in Perl 6. Then you don't have to worry about whether picosecond resolution is good enough. Time and duration objects can, of course, do whatever they like internally, and among themselves, but someone who says sleep($PI) should get a $PI second sleep. Our computers are capable of floating point these days, and I consider any other numeric time format to be cultural baggage. I particularly loathe any kind of two integer format. Sorry about the rant, but you seem to have pushed one of my hot buttons... Larry