local time (was: something about Celeste)

David T. Lewis lewis at mail.msen.com
Fri Dec 3 05:29:36 UTC 1999


--bp/iNruPH9dso1Pn
Content-Type: text/plain; charset=us-ascii


On Wed, Dec 01, 1999 at 11:04:35PM +0000, Lex Spoon wrote:
> Okay, here is a proposal for minimal support of local time.

<snip>

> So does this sound reasonable to people?  It seems like just the ticket
> to get Celeste's Date field going, and it seems like enough to get an
> HTTP cache with expiry going if anyone wants to try for that.
> 
> Lex

Sounds reasonable to me.

I would suggest one minor implemention tweak: There is no need to pass
an array to primitiveLocalSecondsClockWithOffset.  It's easy to instantiate
the array in the primitive, so the wrapper around the primitive becomes:

primLocalSecondsClockWithOffset
        "calculate the local time, and its ofset from UCT"
        <primitive: 'primitiveLocalSecondsClockWithOffset' module: 'time'>

        "if failed, assume UTC time  (modify this if you want it to assume
	some other time zone by default"
        ^ Array with: self primSecondsClock with: 0


The new primitive belongs in interp.c (I don't think it should be a pluggable
primitive), but in the interest of moving things forward, I'm attaching a
pluggable primitive to implement primitiveLocalSecondsClockWithOffset on Unix
systems, along with a modification to your change set so the primitive is
called properly with no arguments. This should permit testing the code without
messing around with the stock VM.

Perhaps someone with a Windows and/or Mac compilation environment can check
and see if the primitive builds on those systems?

Dave


--bp/iNruPH9dso1Pn
Content-Type: text/plain; name="SimpleTimePlugin.st"
 ; x-mac-type="54455854"
 ; x-mac-creator="522A6368"
Content-Disposition: attachment; filename="SimpleTimePlugin.st"
Content-Transfer-Encoding: imap_stub

0,1966,2,2578,76,

--bp/iNruPH9dso1Pn
Content-Type: text/plain; name="Lex's Time Function.2Dece930pm."
 ; x-mac-type="54455854"
 ; x-mac-creator="522A6368"
Content-Disposition: attachment; filename="Lex's Time Function.2Dece930pm."
Content-Transfer-Encoding: imap_stub

0,1966,3,2440,66,

--bp/iNruPH9dso1Pn--





More information about the Squeak-dev mailing list