[UPDATES] 52 for Squeak3.7alpha, advance to 3.7beta - problems

Frank Shearar frank.shearar at rnid.org.uk
Thu Apr 1 11:32:58 UTC 2004


> >>> "Avi Bryant" 04/01/04 11:47 >>>
>
>
> On Apr 1, 2004, at 2:23 AM, Brent Pinkney wrote:
>
> > This in turn removes the key monotonic functionality where
> >
> > 	(DateAndTime now) < (DateAndTime now)
> >
> > This is key to any application that needs sorted timestamps.

<snip>
> The only specification I know of for the DateAndTime class is
> the ANSI
> specification, and it certainly doesn't require "monotonicity" as you
> define it.

With the caveat that I've only got a copy of the final draft of the ANSI
standard, section 5.8.4.6 (Message #now of the DateAndTime factory) says
nothing about monotonicity, strict or otherwise. In fact, I can't find a
single occurence of the string "monoton" in the entire document.

The ANSI final draft says that a time period of DateAndTime
class>>clockPrecision must elapse before #now is guaranteed to return a
different result. DateAndTime class>>clockPrecision currently returns a
nanosecond, but #now only returns a value precise to a second. There's
therefore a conflict in meaning between the two.

The monotonicity invariant isn't actually (DateAndTime now) < (DateAndTime
now). It's more like

| timeThen timeNow |
timeThen := DateAndTime now.
Delay forDuration: DateAndTime clockPrecision. "Assuming that Delay can
pause for a brief enough duration!"
timeNow := DateAndTime now.
self assert: timeThen < timeNow.

frank





More information about the Squeak-dev mailing list