Very, very preliminary port of Chronos to Squeak published to SqueakMap

Alan Lovejoy squeak-dev.sourcery at forum-mail.net
Sat Feb 25 06:09:34 UTC 2006


Avi Bryant is currently working on a port of Chronos
<http://www.chronos-st.org/>  to Squeak. He has
<http://map.squeak.org/package/46b5731f-5112-4157-94d3-d40c4ed8304d>
published a Monticello package to SqueakMap that contains a very preliminary
port.  It is very much a "work in progress." When Avi is satisfied that the
port is sufficiently functional and stable, he will make a general
announcement to that effect.  No promises have been made with respect to
when a version suitable for general use may become available, nor is there
any commitment to provide all the same functionality as is available from
the VisualWorks version. Of course, nothing prevents others from
contributing improvements/enhancements in addition to whatever Avi
publishes.
 
Initially, Avi does not plan to port the Chronos Time Zone Compiler to
Squeak.  Tthe Chronos Time Zone Compiler is used to generate the Chronos
Time Zone  <http://www.chronos-st.org/downloads/time-zones.zip> Repository
from the information provided by the Olson Time Zone Database
<http://www.twinsun.com/tz/tz-link.htm> . Since the Chronos Time
<http://www.chronos-st.org/downloads/time-zones.zip> Zone Repository a) is
available from the Chronos web site <http://www.chronos-st.org/> , and b) is
usable "as is" by any Smalltalk implementation (in fact, it would be usable
by any programming language, given a sufficiently powerful time zone
implementation written in that language,)  that's not that big of an issue.
 
It's only recently that I have become at all familiar with Avi's work.
Initially, I only knew he was one of the principal authors of Seaside.  But
<http://map.squeak.org/accountbyid/04ec7571-cb7e-47ea-b1fc-218f7ec45adc>
he's done much more than just that (although Seaside is impressive enough by
itself.) 
 
I am very appreciative of the contributution Avi is making towards porting
Chronos to Squeak.
 
Fair warning: As of Sat, 25 Feb 2006 03:31:56 +0000 (Universal Time,) the
version on SqueakMap will not work "as is" in versions of Squeak from 3.7
onward (you can load it, but if you execute the initialization/installation
"do it" that the pop-up Transcript window suggests, you will then be unable
to either save the image or compile any methods.)  The problem is caused by
the fact that the installation procedure (as implemented in the version
currently available from SqueakMap) redefines both DateAndTime and Duration
so that they are aliases for the Chronos classes Timepoint and
ScientificDuration (respectively,) in place of the native Chronology classes
named DateAndTime and Duration (and this issue is precisely why I chose not
to use the names "DateAndTime" and "Duration" as class names.) This problem
can be fixed if, before evaluating the 'ChronosEnvironment install' "do it"
as suggested, the following class method is first implemented: 
 
ChronosSqueakEnvironment class>>setProtectedGlobalVariables 
    ProtectedGlobalVariables := Set with: #ScaledDecimal with: #DateAndTime
with: #Duration. 
 
Avi is using Squeak 3.6 to do the porting work.  The Chronology library did
not become part of standard Squeak until version 3.7, and so there is no
issue raised by (re)defining the globals DateAndTime and Duration as global
aliases for Timepoint and ScientificDuration (respectively) in versions of
Squeak prior to 3.7.  That may well be why Avi is using Squeak 3.6 to do the
port. (Squeak badly needs a mechanism to more elegantly handle issues such
as this one.)
 
Note that the version currently available from SqueakMap has not been given
the ability to access files--so it can't retrieve any time zones from the
<http://www.chronos-st.org/downloads/time-zones.zip> Chronos Time Zone
Repository, and therefore Olson time zone keys such as
'Americal/Los_Angeles', 'Europe/Paris' and 'Asia/Tokyo' cannot be used to
identify a time zone. Nor is there any code that makes any attempt to
determine the local time zone from the host operating system, nor any code
that provides any locale information. 
 
Consequently, the Chronos system time zone simply defaults to Universal Time
(which is what the native Chronology library does also, so at least you're
no worse off than you were before.)  Nevertheless, you can still do quite a
bit. For example, after loading and properly initializing Chronos, you can
evaluate the following expression to set the Chronos system time zone so
that it matches the zone rules that have been in effect since 1996 for
CET/CEST (Central European Time):
 
    (ChronosTimezone
        key: #'Europe/Berlin' name: #'Central European Time'
        initialOffset: (ScientificDuration hours: 1) withAbbreviation: #CET 
            until: (WeekOfMonthDayOfWeek month: 3 week: 0 dayOfWeek: 1) "The
'zeroeth week' means the last week of the month"
            at: (TimeOfDay hour: 1 minute: 0 second: 0) relativity:
#universal
        thenOffset: (ScientificDuration hours: 2)  withAbbreviation: #CEST  
            until: (WeekOfMonthDayOfWeek month: 10 week: 0 dayOfWeek: 1) 
            at: (TimeOfDay hour: 1 minute: 0 second: 0) relativity:
#universal)
                beSystem
 
Then, you can evaluate "Timepoint now" to see the current time. And if you
find yourself in Madrid, Paris, Berlin or Amsterdam, the answer will even be
correct.  However, due to the fact that the Squeak system clock reports
local time, setting the Chronos system time zone has no effect on what is
displayed when "Timepoint now" is evaluated.  It only changes the results of
evaluating "Timepoint utNow."   On a system whose clock reported Universal
Time, the situation would be reversed.
 
--Alan
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060224/a623ac8f/attachment.htm


More information about the Squeak-dev mailing list