Date classes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
42 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Date classes

J J-6
Hi all,

I am doing some stuff with dates and I noticed the date classes that come
with the default Squeak image are very nice and very close to having
everything I would want.  But there are a few inconsistencies here and
there, and things missing that would make things easier.

So what is the procedure to updating this?  I think it's part of the core
system so I probably can't just do a monicello package update somewhere?  Do
I have to do it through mantis?

Thanks,
Jason

_________________________________________________________________
Download Messenger. Join the i’m Initiative. Help make a difference today.
http://im.live.com/messenger/im/home/?source=TAGHM_APR07


Reply | Threaded
Open this post in threaded view
|

Re: Date classes

hernan.wilkinson
Before doing something with Date, I recommend you to take a look at "Chalten" or "Cronos". Chalten is in SqueakSource.... I think Cronos too.

Hernan.

On 4/16/07, J J <[hidden email]> wrote:
Hi all,

I am doing some stuff with dates and I noticed the date classes that come
with the default Squeak image are very nice and very close to having
everything I would want.  But there are a few inconsistencies here and
there, and things missing that would make things easier.

So what is the procedure to updating this?  I think it's part of the core
system so I probably can't just do a monicello package update somewhere?  Do
I have to do it through mantis?

Thanks,
Jason

_________________________________________________________________
Download Messenger. Join the i'm Initiative. Help make a difference today.
http://im.live.com/messenger/im/home/?source=TAGHM_APR07





Reply | Threaded
Open this post in threaded view
|

Re: Date classes

Giuseppe Luigi Punzi-2

Chronos: http://www.chronos-st.org/

Hernan Wilkinson escribió:

> Before doing something with Date, I recommend you to take a look at
> "Chalten" or "Cronos". Chalten is in SqueakSource.... I think Cronos too.
>
> Hernan.
>
> On 4/16/07, *J J* <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi all,
>
>     I am doing some stuff with dates and I noticed the date classes
>     that come
>     with the default Squeak image are very nice and very close to having
>     everything I would want.  But there are a few inconsistencies here
>     and
>     there, and things missing that would make things easier.
>
>     So what is the procedure to updating this?  I think it's part of
>     the core
>     system so I probably can't just do a monicello package update
>     somewhere?  Do
>     I have to do it through mantis?
>
>     Thanks,
>     Jason
>
>     _________________________________________________________________
>     Download Messenger. Join the i'm Initiative. Help make a
>     difference today.
>     http://im.live.com/messenger/im/home/?source=TAGHM_APR07
>
>
>
> ------------------------------------------------------------------------
>
>
>  


Reply | Threaded
Open this post in threaded view
|

Re: Date classes

Philippe Marschall
In reply to this post by hernan.wilkinson
Chronos is way ahead of Chalten in terms of functionality.

Philippe

2007/4/16, Hernan Wilkinson <[hidden email]>:

> Before doing something with Date, I recommend you to take a look at
> "Chalten" or "Cronos". Chalten is in SqueakSource.... I think Cronos too.
>
> Hernan.
>
>
> On 4/16/07, J J <[hidden email]> wrote:
> > Hi all,
> >
> > I am doing some stuff with dates and I noticed the date classes that come
> > with the default Squeak image are very nice and very close to having
> > everything I would want.  But there are a few inconsistencies here and
> > there, and things missing that would make things easier.
> >
> > So what is the procedure to updating this?  I think it's part of the core
> > system so I probably can't just do a monicello package update somewhere?
> Do
> > I have to do it through mantis?
> >
> > Thanks,
> > Jason
> >
> >
> _________________________________________________________________
> > Download Messenger. Join the i'm Initiative. Help make a difference today.
> > http://im.live.com/messenger/im/home/?source=TAGHM_APR07
> >
> >
> >
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Date classes

J J-6
In reply to this post by hernan.wilkinson
I have looked at Cronos but it is really huge, and the classes that come
with the image are already very close.  I will have to look at Chalten, but
what is wrong with a few upgrades to the classes that come with Squeak?

>From: "Hernan Wilkinson" <[hidden email]>
>Reply-To: The general-purpose Squeak developers
>list<[hidden email]>
>To: "The general-purpose Squeak developers
>list"<[hidden email]>
>Subject: Re: Date classes
>Date: Mon, 16 Apr 2007 14:28:09 -0300
>
>Before doing something with Date, I recommend you to take a look at
>"Chalten" or "Cronos". Chalten is in SqueakSource.... I think Cronos too.
>
>Hernan.
>
>On 4/16/07, J J <[hidden email]> wrote:
>>
>>Hi all,
>>
>>I am doing some stuff with dates and I noticed the date classes that come
>>with the default Squeak image are very nice and very close to having
>>everything I would want.  But there are a few inconsistencies here and
>>there, and things missing that would make things easier.
>>
>>So what is the procedure to updating this?  I think it's part of the core
>>system so I probably can't just do a monicello package update
>>somewhere?  Do
>>I have to do it through mantis?
>>
>>Thanks,
>>Jason
>>
>>_________________________________________________________________
>>Download Messenger. Join the i'm Initiative. Help make a difference today.
>>http://im.live.com/messenger/im/home/?source=TAGHM_APR07
>>
>>
>>


>

_________________________________________________________________
Get a FREE Web site, company branded e-mail and more from Microsoft Office
Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/


Reply | Threaded
Open this post in threaded view
|

Re: Date classes

Philippe Marschall
They are not maintained anymore, patches don't get integrated.

Philippe

2007/4/16, J J <[hidden email]>:

> I have looked at Cronos but it is really huge, and the classes that come
> with the image are already very close.  I will have to look at Chalten, but
> what is wrong with a few upgrades to the classes that come with Squeak?
>
> >From: "Hernan Wilkinson" <[hidden email]>
> >Reply-To: The general-purpose Squeak developers
> >list<[hidden email]>
> >To: "The general-purpose Squeak developers
> >list"<[hidden email]>
> >Subject: Re: Date classes
> >Date: Mon, 16 Apr 2007 14:28:09 -0300
> >
> >Before doing something with Date, I recommend you to take a look at
> >"Chalten" or "Cronos". Chalten is in SqueakSource.... I think Cronos too.
> >
> >Hernan.
> >
> >On 4/16/07, J J <[hidden email]> wrote:
> >>
> >>Hi all,
> >>
> >>I am doing some stuff with dates and I noticed the date classes that come
> >>with the default Squeak image are very nice and very close to having
> >>everything I would want.  But there are a few inconsistencies here and
> >>there, and things missing that would make things easier.
> >>
> >>So what is the procedure to updating this?  I think it's part of the core
> >>system so I probably can't just do a monicello package update
> >>somewhere?  Do
> >>I have to do it through mantis?
> >>
> >>Thanks,
> >>Jason
> >>
> >>_________________________________________________________________
> >>Download Messenger. Join the i'm Initiative. Help make a difference today.
> >>http://im.live.com/messenger/im/home/?source=TAGHM_APR07
> >>
> >>
> >>
>
>
> >
>
> _________________________________________________________________
> Get a FREE Web site, company branded e-mail and more from Microsoft Office
> Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Date classes

Philippe Marschall
In reply to this post by J J-6
Chronos also has a very interesting blog with lots of stuff, that you
never wanted to know, but still have to know.

examples:
http://chronos-st.blogspot.com/2006/12/chronos-101-points-in-time.html
http://chronos-st.blogspot.com/2007/01/chronos-101-durational-values.html
http://chronos-st.blogspot.com/2007/01/chronos-101-intervals-of-time.html

Philippe

2007/4/16, J J <[hidden email]>:

> I have looked at Cronos but it is really huge, and the classes that come
> with the image are already very close.  I will have to look at Chalten, but
> what is wrong with a few upgrades to the classes that come with Squeak?
>
> >From: "Hernan Wilkinson" <[hidden email]>
> >Reply-To: The general-purpose Squeak developers
> >list<[hidden email]>
> >To: "The general-purpose Squeak developers
> >list"<[hidden email]>
> >Subject: Re: Date classes
> >Date: Mon, 16 Apr 2007 14:28:09 -0300
> >
> >Before doing something with Date, I recommend you to take a look at
> >"Chalten" or "Cronos". Chalten is in SqueakSource.... I think Cronos too.
> >
> >Hernan.
> >
> >On 4/16/07, J J <[hidden email]> wrote:
> >>
> >>Hi all,
> >>
> >>I am doing some stuff with dates and I noticed the date classes that come
> >>with the default Squeak image are very nice and very close to having
> >>everything I would want.  But there are a few inconsistencies here and
> >>there, and things missing that would make things easier.
> >>
> >>So what is the procedure to updating this?  I think it's part of the core
> >>system so I probably can't just do a monicello package update
> >>somewhere?  Do
> >>I have to do it through mantis?
> >>
> >>Thanks,
> >>Jason
> >>
> >>_________________________________________________________________
> >>Download Messenger. Join the i'm Initiative. Help make a difference today.
> >>http://im.live.com/messenger/im/home/?source=TAGHM_APR07
> >>
> >>
> >>
>
>
> >
>
> _________________________________________________________________
> Get a FREE Web site, company branded e-mail and more from Microsoft Office
> Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Date classes

keith1y
In reply to this post by J J-6
Do check the latest iterations of some fixes for DateAndTime here
( http://bugs.squeak.org/view.php?id=474) , in particular this includes
a fully tested implementation of the millisecond clock.

For testing you will need SUnit and SUnitGUI from
http://www.squeaksource.com/Testing
Because it uses ClassClonerTestResource to clone the DataAndTime class
for testing without messing with the main system clock.


from my last note:
> I am pleased to announce a testable/tested incarnation of the
> millisecond clock implementation. It is much faster too. This handles
> the clock rollover, and midnight rollovers.
>
> If the clock is not used for a number of days and may have lost
> synchronisation then a sanity check is performed that will recalculate
> the offsets.
The updates can be quite tricky to load, but I hope to see them in 3.10
(Edgar?) It would be great if you could try them out and offer feedback
first.

best regards

Keith

> Hi all,
>
> I am doing some stuff with dates and I noticed the date classes that
> come with the default Squeak image are very nice and very close to
> having everything I would want.  But there are a few inconsistencies
> here and there, and things missing that would make things easier.
>
> So what is the procedure to updating this?  I think it's part of the
> core system so I probably can't just do a monicello package update
> somewhere?  Do I have to do it through mantis?
>
> Thanks,
> Jason


Reply | Threaded
Open this post in threaded view
|

Re: Date classes

keith1y
In reply to this post by J J-6
J J wrote:
> I have looked at Cronos but it is really huge, and the classes that
> come with the image are already very close.  I will have to look at
> Chalten, but what is wrong with a few upgrades to the classes that
> come with Squeak?
Absolutely nothing, the squeak classes recently had a fairly
comprehensive rewrite, and are still essentially a 1.0 release, it
should be expected that some updates and improvements are desired. There
is plenty of room for these base classes to evolve. For example I would
also propose a split in the packaging of these classes so there can be
an absolute minimum Kernel version for KernelImages as well as a fully
featured version.

Goran also submitted a number of speed improvements to mantis,
http://bugs.squeak.org/view.php?id=4669

cheers

Keith

Reply | Threaded
Open this post in threaded view
|

Re: Date classes

Andreas.Raab
Keith Hodges wrote:

> J J wrote:
>> I have looked at Cronos but it is really huge, and the classes that
>> come with the image are already very close.  I will have to look at
>> Chalten, but what is wrong with a few upgrades to the classes that
>> come with Squeak?
> Absolutely nothing, the squeak classes recently had a fairly
> comprehensive rewrite, and are still essentially a 1.0 release, it
> should be expected that some updates and improvements are desired. There
> is plenty of room for these base classes to evolve. For example I would
> also propose a split in the packaging of these classes so there can be
> an absolute minimum Kernel version for KernelImages as well as a fully
> featured version.

I have been experimenting with this idea recently and the bottom line is
that all you *really* need is access to the millisecond clock primitive
(for Delay and friends). Pretty much everything else can be built on top
of that without access to more elaborate Date and Time classes. Moving
#millisecondClockValue into, say, Delay would make a great starting
point to rip out all of the Chronology classes for a minimal image.

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: Date classes

stephane ducasse
In reply to this post by keith1y
After thinking a lot of the improving of squeak I have the impression  
that this would have been much better to have
external packages that people use and enhance instead of having  
Chronology inside. Chronology could have also been such external
package. This way the kernel of squeak could have been just what is  
needed to manage the internal of the system.
This way we get something small and specific and clients can use  
packages that fits their specific needs.
Now that Chronology is in squeak it is important to fix it if there  
are problems and inconsistencies.
The best is to submit fixes with tests.

>> I have looked at Cronos but it is really huge, and the classes  
>> that come with the image are already very close.  I will have to  
>> look at Chalten, but what is wrong with a few upgrades to the  
>> classes that come with Squeak?
> Absolutely nothing, the squeak classes recently had a fairly  
> comprehensive rewrite, and are still essentially a 1.0 release, it  
> should be expected that some updates and improvements are desired.  
> There is plenty of room for these base classes to evolve. For  
> example I would also propose a split in the packaging of these  
> classes so there can be an absolute minimum Kernel version for  
> KernelImages as well as a fully featured version.
>
> Goran also submitted a number of speed improvements to mantis,  
> http://bugs.squeak.org/view.php?id=4669

If this is good the harvesting team should harvest them.

Stef

>
> cheers
>
> Keith
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Date classes

stephane ducasse
In reply to this post by Andreas.Raab

On 17 avr. 07, at 01:42, Andreas Raab wrote:

> Keith Hodges wrote:
>> J J wrote:
>>> I have looked at Cronos but it is really huge, and the classes  
>>> that come with the image are already very close.  I will have to  
>>> look at Chalten, but what is wrong with a few upgrades to the  
>>> classes that come with Squeak?
>> Absolutely nothing, the squeak classes recently had a fairly  
>> comprehensive rewrite, and are still essentially a 1.0 release, it  
>> should be expected that some updates and improvements are desired.  
>> There is plenty of room for these base classes to evolve. For  
>> example I would also propose a split in the packaging of these  
>> classes so there can be an absolute minimum Kernel version for  
>> KernelImages as well as a fully featured version.
>
> I have been experimenting with this idea recently and the bottom  
> line is that all you *really* need is access to the millisecond  
> clock primitive (for Delay and friends). Pretty much everything  
> else can be built on top of that without access to more elaborate  
> Date and Time classes. Moving #millisecondClockValue into, say,  
> Delay would make a great starting point to rip out all of the  
> Chronology classes for a minimal image.

andreas don't you think that for the kernel having the old pre-
chronology kernel is not sufficient (was it that big)?
because there are a lot of things that could be removed from pavel  
images (at least this was my impression).
>
> Cheers,
>   - Andreas
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Date classes

hernan.wilkinson
In reply to this post by J J-6
Just to give you a fast review of what I remember (I developed the model that Maxi Taborda converted into Chalten):
1) Chronos supports many calendars, Chalten only the Gregorian Calendar
2) Chronos supports time zones, Chalten does not
3) Choros is huge (as you mentions), Chalten is more manageable (because it just model the Gregorian Calendar)
4) Chronos lacks some abstractions that Chalten has, like Day of Month and others (I don't remember now...there are a couple of mails that I and the guy that created Chronos wrote about these issues, like one year ago)
5) Chalten is based on a arithmetic model that allows you to represent time measurements easily (like 3 days, 5 months, etc). These objects are polymorphic with numbers respect to the arithmetic messages such as +, -, *, etc., that means that you can use them in arithmetic formulas
5) And of course, I like Chalten's model more that Chronos :-). For me it is easier to use, but this is just a matter of taste...

There is a paper we wrote 2 years ago about the problems that the Smalltalk date classes have and the advantages of having a better model. If you are interested on having better date and time classes, I recommend you to read the paper... you may not like it, but at least you will see other people ideas...
We use that model (Chalten) in a production system and we believe it allowed us to avoid many common mistakes related to financial systems.... but hey, that's just a feeling, nothing I can prove formally.

I hope you can do something useful.
Bye,
Hernan.


On 4/16/07, J J <[hidden email]> wrote:
I have looked at Cronos but it is really huge, and the classes that come
with the image are already very close.  I will have to look at Chalten, but
what is wrong with a few upgrades to the classes that come with Squeak?

>From: "Hernan Wilkinson" <[hidden email]>
>Reply-To: The general-purpose Squeak developers
>list<[hidden email]>
>To: "The general-purpose Squeak developers
>list"<[hidden email]>
>Subject: Re: Date classes
>Date: Mon, 16 Apr 2007 14:28:09 -0300
>
>Before doing something with Date, I recommend you to take a look at
>"Chalten" or "Cronos". Chalten is in SqueakSource.... I think Cronos too.
>
>Hernan.
>
>On 4/16/07, J J <[hidden email]> wrote:
>>
>>Hi all,
>>
>>I am doing some stuff with dates and I noticed the date classes that come
>>with the default Squeak image are very nice and very close to having
>>everything I would want.  But there are a few inconsistencies here and
>>there, and things missing that would make things easier.
>>
>>So what is the procedure to updating this?  I think it's part of the core
>>system so I probably can't just do a monicello package update
>>somewhere?  Do
>>I have to do it through mantis?
>>
>>Thanks,
>>Jason
>>
>>_________________________________________________________________
>>Download Messenger. Join the i'm Initiative. Help make a difference today.
>>http://im.live.com/messenger/im/home/?source=TAGHM_APR07
>>
>>
>>


>

_________________________________________________________________
Get a FREE Web site, company branded e-mail and more from Microsoft Office
Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/





Reply | Threaded
Open this post in threaded view
|

Re: Date classes

Philippe Marschall
2007/4/17, Hernan Wilkinson <[hidden email]>:
> Just to give you a fast review of what I remember (I developed the model
> that Maxi Taborda converted into Chalten):
> 1) Chronos supports many calendars, Chalten only the Gregorian Calendar
> 2) Chronos supports time zones, Chalten does not

Additionally Chronos also supports nominal time and leap seconds.

> 3) Choros is huge (as you mentions), Chalten is more manageable (because it
> just model the Gregorian Calendar)
> 4) Chronos lacks some abstractions that Chalten has, like Day of Month and
> others (I don't remember now...there are a couple of mails that I and the
> guy that created Chronos wrote about these issues, like one year ago)
> 5) Chalten is based on a arithmetic model that allows you to represent time
> measurements easily (like 3 days, 5 months, etc).

That won't work in Squeak because these methods are already by the
Squeak Chronology (unless you have classboxes). It might work in VW
though.

> These objects are
> polymorphic with numbers respect to the arithmetic messages such as +, -, *,
> etc., that means that you can use them in arithmetic formulas

That's true to a certain extent in Chronos for example you can:
Timepoint now - (CalendarDuration months: 1)
(CalendarDuration months: 1) * 5
but you can't:
5 * (CalendarDuration months: 1)

> 5) And of course, I like Chalten's model more that Chronos :-). For me it is
> easier to use, but this is just a matter of taste...
>
> There is a paper we wrote 2 years ago about the problems that the Smalltalk
> date classes have and the advantages of having a better model. If you are
> interested on having better date and time classes, I recommend you to read
> the paper... you may not like it, but at least you will see other people
> ideas...
> We use that model (Chalten) in a production system and we believe it allowed
> us to avoid many common mistakes related to financial systems.... but hey,
> that's just a feeling, nothing I can prove formally.
>
> I hope you can do something useful.
> Bye,

Chronos is a bit ugly in Squeak because Squeak does not support
namespaces which means that classes that model the same concept as
Squeak Chronology classes have different names (unless you mess with
shared pools). Also loading it is a bit of a pain with Monticello
(this is the fault of Monticello and not Chronos).

Cheers
Philippe

> Hernan.
>
>
> On 4/16/07, J J <[hidden email]> wrote:
> > I have looked at Cronos but it is really huge, and the classes that come
> > with the image are already very close.  I will have to look at Chalten,
> but
> > what is wrong with a few upgrades to the classes that come with Squeak?
> >
> > >From: "Hernan Wilkinson" <[hidden email]>
> > >Reply-To: The general-purpose Squeak developers
> > >list< [hidden email]>
> > >To: "The general-purpose Squeak developers
> > >list"<[hidden email]>
> > >Subject: Re: Date classes
> > >Date: Mon, 16 Apr 2007 14:28:09 -0300
> > >
> > >Before doing something with Date, I recommend you to take a look at
> > >"Chalten" or "Cronos". Chalten is in SqueakSource.... I think Cronos too.
> > >
> > >Hernan.
> > >
> > >On 4/16/07, J J <[hidden email]> wrote:
> > >>
> > >>Hi all,
> > >>
> > >>I am doing some stuff with dates and I noticed the date classes that
> come
> > >>with the default Squeak image are very nice and very close to having
> > >>everything I would want.  But there are a few inconsistencies here and
> > >>there, and things missing that would make things easier.
> > >>
> > >>So what is the procedure to updating this?  I think it's part of the
> core
> > >>system so I probably can't just do a monicello package update
> > >>somewhere?  Do
> > >>I have to do it through mantis?
> > >>
> > >>Thanks,
> > >>Jason
> > >>
> >
> >>_________________________________________________________________
> > >>Download Messenger. Join the i'm Initiative. Help make a difference
> today.
> >
> >>http://im.live.com/messenger/im/home/?source=TAGHM_APR07
> > >>
> > >>
> > >>
> >
> >
> > >
> >
> >
> _________________________________________________________________
> > Get a FREE Web site, company branded e-mail and more from Microsoft Office
> > Live!
> http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
> >
> >
> >
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Date classes

hernan.wilkinson

Additionally Chronos also supports nominal time and leap seconds.

Maxi Taborda is enhancing Chalten adding that functionality... but is going to take some time :-) ...

> 5) Chalten is based on a arithmetic model that allows you to represent time
> measurements easily (like 3 days, 5 months, etc).

That won't work in Squeak because these methods are already by the
Squeak Chronology (unless you have classboxes). It might work in VW
though.

It works on Squeak,  VW, VisualAge, Dolphin and GemStone that are the Smalltalk were Chalten has been migrated to. Look at Aconcagua, the model that takes care of this.

> These objects are
> polymorphic with numbers respect to the arithmetic messages such as +, -, *,
> etc., that means that you can use them in arithmetic formulas

That's true to a certain extent in Chronos for example you can:
Timepoint now - (CalendarDuration months: 1)
(CalendarDuration months: 1) * 5
but you can't:
5 * (CalendarDuration months: 1)

Ok, but it is not only the functionality what it is important for us... for us it is also important the way you "write" these things... for example, with Chalten/Aconcagua you can write:

5 * month ---> Equivalent to 5 * (CalendarDuration months: 1)
5 * meter / (second * second) --> A measure of acceleration if you create meter as a unit using Aconcagua
1/10 * year --> Represents an interest rate of 10% yearly.

As you can see, time measure are not only related only to the time domain but used in other domains... that is way for us it is important to support this type of behavior and in a DSL way...

Bye,
Hernan.

> 5) And of course, I like Chalten's model more that Chronos :-). For me it is

> easier to use, but this is just a matter of taste...
>
> There is a paper we wrote 2 years ago about the problems that the Smalltalk
> date classes have and the advantages of having a better model. If you are
> interested on having better date and time classes, I recommend you to read
> the paper... you may not like it, but at least you will see other people
> ideas...
> We use that model (Chalten) in a production system and we believe it allowed
> us to avoid many common mistakes related to financial systems.... but hey,
> that's just a feeling, nothing I can prove formally.
>
> I hope you can do something useful.
> Bye,

Chronos is a bit ugly in Squeak because Squeak does not support
namespaces which means that classes that model the same concept as
Squeak Chronology classes have different names (unless you mess with
shared pools). Also loading it is a bit of a pain with Monticello
(this is the fault of Monticello and not Chronos).

Cheers
Philippe

> Hernan.
>
>
> On 4/16/07, J J <[hidden email]> wrote:
> > I have looked at Cronos but it is really huge, and the classes that come
> > with the image are already very close.  I will have to look at Chalten,
> but
> > what is wrong with a few upgrades to the classes that come with Squeak?
> >
> > >From: "Hernan Wilkinson" <[hidden email]>
> > >Reply-To: The general-purpose Squeak developers
> > >list< [hidden email]>
> > >To: "The general-purpose Squeak developers
> > >list"<[hidden email]>
> > >Subject: Re: Date classes
> > >Date: Mon, 16 Apr 2007 14:28:09 -0300
> > >
> > >Before doing something with Date, I recommend you to take a look at
> > >"Chalten" or "Cronos". Chalten is in SqueakSource.... I think Cronos too.
> > >
> > >Hernan.
> > >
> > >On 4/16/07, J J <[hidden email]> wrote:
> > >>
> > >>Hi all,
> > >>
> > >>I am doing some stuff with dates and I noticed the date classes that
> come
> > >>with the default Squeak image are very nice and very close to having
> > >>everything I would want.  But there are a few inconsistencies here and
> > >>there, and things missing that would make things easier.
> > >>
> > >>So what is the procedure to updating this?  I think it's part of the
> core
> > >>system so I probably can't just do a monicello package update
> > >>somewhere?  Do
> > >>I have to do it through mantis?
> > >>
> > >>Thanks,
> > >>Jason
> > >>
> >
> >>_________________________________________________________________
> > >>Download Messenger. Join the i'm Initiative. Help make a difference
> today.
> >
> >>http://im.live.com/messenger/im/home/?source=TAGHM_APR07
> > >>
> > >>
> > >>
> >
> >
> > >
> >
> >
> _________________________________________________________________
> > Get a FREE Web site, company branded e-mail and more from Microsoft Office
> > Live!
> http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
> >
> >
> >
>
>
>
>
>




Reply | Threaded
Open this post in threaded view
|

Re: Date classes

Philippe Marschall
2007/4/17, Hernan Wilkinson <[hidden email]>:

>
> >
> > Additionally Chronos also supports nominal time and leap seconds.
>
>  Maxi Taborda is enhancing Chalten adding that functionality... but is going
> to take some time :-) ...
>
> > > 5) Chalten is based on a arithmetic model that allows you to represent
> time
> > > measurements easily (like 3 days, 5 months, etc).
> >
> > That won't work in Squeak because these methods are already by the
> > Squeak Chronology (unless you have classboxes). It might work in VW
> > though.
>
> It works on Squeak,  VW, VisualAge, Dolphin and GemStone that are the
> Smalltalk were Chalten has been migrated to. Look at Aconcagua, the model
> that takes care of this.

I loaded Aconcagua-mx.1.6 and Chalten-mx.1.3 in Squeak 3.9. The
following all give errors:

GregorianDay today + 1 day
GregorianDateTime now + 1 day
GregorianDay today next: 5
GregorianYear current + 1 year
5 months

I guess I have to thank you. After hearing what a piece of shit
Seaside is because of its lack of documentation it's relieving to see
a framework with no class comments at all. A quick browsing through
same classes showed also no method comments.

Cheers
Philippe

> > > These objects are
> > > polymorphic with numbers respect to the arithmetic messages such as +,
> -, *,
> > > etc., that means that you can use them in arithmetic formulas
> >
> > That's true to a certain extent in Chronos for example you can:
> > Timepoint now - (CalendarDuration months: 1)
> > (CalendarDuration months: 1) * 5
> > but you can't:
> > 5 * (CalendarDuration months: 1)
>
> Ok, but it is not only the functionality what it is important for us... for
> us it is also important the way you "write" these things... for example,
> with Chalten/Aconcagua you can write:
>
> 5 * month ---> Equivalent to 5 * (CalendarDuration months: 1)
> 5 * meter / (second * second) --> A measure of acceleration if you create
> meter as a unit using Aconcagua
> 1/10 * year --> Represents an interest rate of 10% yearly.
>
> As you can see, time measure are not only related only to the time domain
> but used in other domains... that is way for us it is important to support
> this type of behavior and in a DSL way...
>
> Bye,
> Hernan.
>
> > > 5) And of course, I like Chalten's model more that Chronos :-). For me
> it is
> > > easier to use, but this is just a matter of taste...
> > >
> > > There is a paper we wrote 2 years ago about the problems that the
> Smalltalk
> > > date classes have and the advantages of having a better model. If you
> are
> > > interested on having better date and time classes, I recommend you to
> read
> > > the paper... you may not like it, but at least you will see other people
> > > ideas...
> > > We use that model (Chalten) in a production system and we believe it
> allowed
> > > us to avoid many common mistakes related to financial systems.... but
> hey,
> > > that's just a feeling, nothing I can prove formally.
> > >
> > > I hope you can do something useful.
> > > Bye,
> >
> > Chronos is a bit ugly in Squeak because Squeak does not support
> > namespaces which means that classes that model the same concept as
> > Squeak Chronology classes have different names (unless you mess with
> > shared pools). Also loading it is a bit of a pain with Monticello
> > (this is the fault of Monticello and not Chronos).
> >
> > Cheers
> > Philippe
> >
> > > Hernan.
> > >
> > >
> > > On 4/16/07, J J <[hidden email]> wrote:
> > > > I have looked at Cronos but it is really huge, and the classes that
> come
> > > > with the image are already very close.  I will have to look at
> Chalten,
> > > but
> > > > what is wrong with a few upgrades to the classes that come with
> Squeak?
> > > >
> > > > >From: "Hernan Wilkinson" <[hidden email]>
> > > > >Reply-To: The general-purpose Squeak developers
> > > > >list< [hidden email]>
> > > > >To: "The general-purpose Squeak developers
> > > > >list"< [hidden email]>
> > > > >Subject: Re: Date classes
> > > > >Date: Mon, 16 Apr 2007 14:28:09 -0300
> > > > >
> > > > >Before doing something with Date, I recommend you to take a look at
> > > > >"Chalten" or "Cronos". Chalten is in SqueakSource.... I think Cronos
> too.
> > > > >
> > > > >Hernan.
> > > > >
> > > > >On 4/16/07, J J < [hidden email]> wrote:
> > > > >>
> > > > >>Hi all,
> > > > >>
> > > > >>I am doing some stuff with dates and I noticed the date classes that
> > > come
> > > > >>with the default Squeak image are very nice and very close to having
> > > > >>everything I would want.  But there are a few inconsistencies here
> and
> > > > >>there, and things missing that would make things easier.
> > > > >>
> > > > >>So what is the procedure to updating this?  I think it's part of the
> > > core
> > > > >>system so I probably can't just do a monicello package update
> > > > >>somewhere?  Do
> > > > >>I have to do it through mantis?
> > > > >>
> > > > >>Thanks,
> > > > >>Jason
> > > > >>
> > > >
> > >
> >>_________________________________________________________________
> > > > >>Download Messenger. Join the i'm Initiative. Help make a difference
> > > today.
> > > >
> > >
> >>http://im.live.com/messenger/im/home/?source=TAGHM_APR07
> > > > >>
> > > > >>
> > > > >>
> > > >
> > > >
> > > > >
> > > >
> > > >
> > >
> _________________________________________________________________
> > > > Get a FREE Web site, company branded e-mail and more from Microsoft
> Office
> > > > Live!
> > >
> http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Date classes

hernan.wilkinson



I loaded Aconcagua-mx.1.6 and Chalten-mx.1.3 in Squeak 3.9. The
following all give errors:

GregorianDay today + 1 day
GregorianDateTime now + 1 day
GregorianDay today next: 5
GregorianYear current + 1 year
5 months
 

I guess I have to thank you. After hearing what a piece of shit
Seaside is because of its lack of documentation it's relieving to see
a framework with no class comments at all. A quick browsing through
same classes showed also no method comments.

jaja, it seems to me that you did not look good enough.... just look at the Test!!! They are all the documentation you need! and more!! real examples, live code! not just documentation.... We defenetly use different development techniques... Also, remember the paper!
Links:
http://www.iam.unibe.ch/~ducasse/Teaching/CoursAnnecy/0506-M1-COO/A%20New%20Object-Oriented%20Model%20of%20the%20Gregorian%20Calendar.pdf
http://prog2.vub.ac.be/~cderoove/esugtalks/Wilkinson.pdf   (ESUG Presentation)

About the code you tried:
1) GregorianDay today + 1 day  -> It will not work becuase a date is not polymorphic with numbers. You have to do: "GregorianDate today next" or "GregorianDate today next: 1 * day" Remember the *, that allows you to create measures easily

2) GregorianDateTime now + 1 day ---> Same as 1)

3) GregorianDay today next: 5 --> It will not work because 5 is not a measure of time, it is just a number. Try
"GregorianDay today next: 5 * day"  5 * day is a measure of time

4) GregorianYear current + 1 year --> Same as 1) but using a measure expressed in year, for example "2 * year"
5) 5 months --> Measure are created in many ways. We decided not to clutter the number protocol with each unit you could have... because measures are arithmetic representations of a number times its unit, the right way to create them is using the arithmetic operator * (See our paper about Aconcagua. Link:
http://portal.acm.org/citation.cfm?id=1094964&coll=ACM&dl=ACM&CFID=20205775&CFTOKEN=19800555 )

Hope this help.
Hernan.

Cheers
Philippe

> > > These objects are
> > > polymorphic with numbers respect to the arithmetic messages such as +,
> -, *,
> > > etc., that means that you can use them in arithmetic formulas
> >
> > That's true to a certain extent in Chronos for example you can:
> > Timepoint now - (CalendarDuration months: 1)
> > (CalendarDuration months: 1) * 5
> > but you can't:
> > 5 * (CalendarDuration months: 1)
>
> Ok, but it is not only the functionality what it is important for us... for
> us it is also important the way you "write" these things... for example,
> with Chalten/Aconcagua you can write:
>
> 5 * month ---> Equivalent to 5 * (CalendarDuration months: 1)
> 5 * meter / (second * second) --> A measure of acceleration if you create

> meter as a unit using Aconcagua
> 1/10 * year --> Represents an interest rate of 10% yearly.
>
> As you can see, time measure are not only related only to the time domain
> but used in other domains... that is way for us it is important to support
> this type of behavior and in a DSL way...
>
> Bye,
> Hernan.
>
> > > 5) And of course, I like Chalten's model more that Chronos :-). For me
> it is
> > > easier to use, but this is just a matter of taste...
> > >
> > > There is a paper we wrote 2 years ago about the problems that the
> Smalltalk
> > > date classes have and the advantages of having a better model. If you
> are
> > > interested on having better date and time classes, I recommend you to
> read
> > > the paper... you may not like it, but at least you will see other people
> > > ideas...
> > > We use that model (Chalten) in a production system and we believe it
> allowed
> > > us to avoid many common mistakes related to financial systems.... but
> hey,
> > > that's just a feeling, nothing I can prove formally.
> > >
> > > I hope you can do something useful.
> > > Bye,
> >
> > Chronos is a bit ugly in Squeak because Squeak does not support
> > namespaces which means that classes that model the same concept as
> > Squeak Chronology classes have different names (unless you mess with
> > shared pools). Also loading it is a bit of a pain with Monticello
> > (this is the fault of Monticello and not Chronos).
> >
> > Cheers
> > Philippe
> >
> > > Hernan.
> > >
> > >
> > > On 4/16/07, J J <[hidden email]> wrote:
> > > > I have looked at Cronos but it is really huge, and the classes that
> come
> > > > with the image are already very close.  I will have to look at
> Chalten,
> > > but
> > > > what is wrong with a few upgrades to the classes that come with
> Squeak?
> > > >
> > > > >From: "Hernan Wilkinson" <[hidden email]>
> > > > >Reply-To: The general-purpose Squeak developers
> > > > >list< [hidden email]>
> > > > >To: "The general-purpose Squeak developers
> > > > >list"< [hidden email] >
> > > > >Subject: Re: Date classes
> > > > >Date: Mon, 16 Apr 2007 14:28:09 -0300
> > > > >
> > > > >Before doing something with Date, I recommend you to take a look at
> > > > >"Chalten" or "Cronos". Chalten is in SqueakSource.... I think Cronos
> too.
> > > > >
> > > > >Hernan.
> > > > >
> > > > >On 4/16/07, J J < [hidden email]> wrote:

> > > > >>
> > > > >>Hi all,
> > > > >>
> > > > >>I am doing some stuff with dates and I noticed the date classes that
> > > come
> > > > >>with the default Squeak image are very nice and very close to having
> > > > >>everything I would want.  But there are a few inconsistencies here
> and
> > > > >>there, and things missing that would make things easier.
> > > > >>
> > > > >>So what is the procedure to updating this?  I think it's part of the
> > > core
> > > > >>system so I probably can't just do a monicello package update
> > > > >>somewhere?  Do
> > > > >>I have to do it through mantis?
> > > > >>
> > > > >>Thanks,
> > > > >>Jason
> > > > >>

> > > >
> > >
> >>_________________________________________________________________
> > > > >>Download Messenger. Join the i'm Initiative. Help make a difference
> > > today.
> > > >
> > >
> >>http://im.live.com/messenger/im/home/?source=TAGHM_APR07
> > > > >>
> > > > >>
> > > > >>
> > > >
> > > >
> > > > >
> > > >
> > > >
> > >
> _________________________________________________________________
> > > > Get a FREE Web site, company branded e-mail and more from Microsoft
> Office
> > > > Live!
> > >
> http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>
>
>
>




Reply | Threaded
Open this post in threaded view
|

RE: Date classes

Ramon Leon-5
In reply to this post by Philippe Marschall
> I guess I have to thank you. After hearing what a piece of
> shit Seaside is because of its lack of documentation it's
> relieving to see a framework with no class comments at all. A
> quick browsing through same classes showed also no method comments.
>
> Cheers
> Philippe

Hey, Seaside rocks, hard!  Don't let anyone tell you otherwise or make you
feel bad because of a lack of comments.  Comments are nice, but features are
nicer.  You guys do outstanding work, even if it's not said enough, we're
all thinking it.

Ramon Leon
http://onsmalltalk.com


Reply | Threaded
Open this post in threaded view
|

Re: Date classes

Philippe Marschall
In reply to this post by hernan.wilkinson
2007/4/17, Hernan Wilkinson <[hidden email]>:

>
>
>
> >
> > I loaded Aconcagua-mx.1.6 and Chalten-mx.1.3 in Squeak 3.9. The
> > following all give errors:
> >
> > GregorianDay today + 1 day
> > GregorianDateTime now + 1 day
> > GregorianDay today next: 5
> > GregorianYear current + 1 year
> > 5 months
>
>
> > I guess I have to thank you. After hearing what a piece of shit
> > Seaside is because of its lack of documentation it's relieving to see
> > a framework with no class comments at all. A quick browsing through
> > same classes showed also no method comments.
>
> jaja, it seems to me that you did not look good enough.... just look at the
> Test!!! They are all the documentation you need! and more!! real examples,
> live code! not just documentation.... We defenetly use different development
> techniques... Also, remember the paper!
> Links:
> http://www.iam.unibe.ch/~ducasse/Teaching/CoursAnnecy/0506-M1-COO/A%20New%20Object-Oriented%20Model%20of%20the%20Gregorian%20Calendar.pdf
> http://prog2.vub.ac.be/~cderoove/esugtalks/Wilkinson.pdf
>   (ESUG Presentation)

That exists for Seaside too (plus blogs, screen casts, real
applications using it, ...), didn't count for nothing.

> About the code you tried:
> 1) GregorianDay today + 1 day  -> It will not work becuase a date is not
> polymorphic with numbers.

Why? This works fine with Chronos. I find it quite handy to compute
the difference between two points in time by sending #-. Or being able
to add a duration to a timepoint by sending #+. Yeah the type
signatures are different than for standard arithmetic but still.

> You have to do: "GregorianDate today next" or
> "GregorianDate today next: 1 * day" Remember the *, that allows you to
> create measures easily
>
> 2) GregorianDateTime now + 1 day ---> Same as 1)
>
> 3) GregorianDay today next: 5 --> It will not work because 5 is not a
> measure of time, it is just a number. Try
> "GregorianDay today next: 5 * day"  5 * day is a measure of time

Maybe then the suggested type should be aMeasure and not aNumberOfDays

> 4) GregorianYear current + 1 year --> Same as 1) but using a measure
> expressed in year, for example "2 * year"
> 5) 5 months --> Measure are created in many ways. We decided not to clutter
> the number protocol with each unit you could have... because measures are
> arithmetic representations of a number times its unit, the right way to
> create them is using the arithmetic operator * (See our paper about
> Aconcagua. Link:

All good and fine, however the code you posted in this thread suggests
differently. And there is still the question where year comes from
(please no shared pool).

Cheers
Philippe

> http://portal.acm.org/citation.cfm?id=1094964&coll=ACM&dl=ACM&CFID=20205775&CFTOKEN=19800555
> )
>
> Hope this help.
> Hernan.
>
> > Cheers
> > Philippe
> >
> > > > > These objects are
> > > > > polymorphic with numbers respect to the arithmetic messages such as
> +,
> > > -, *,
> > > > > etc., that means that you can use them in arithmetic formulas
> > > >
> > > > That's true to a certain extent in Chronos for example you can:
> > > > Timepoint now - (CalendarDuration months: 1)
> > > > (CalendarDuration months: 1) * 5
> > > > but you can't:
> > > > 5 * (CalendarDuration months: 1)
> > >
> > > Ok, but it is not only the functionality what it is important for us...
> for
> > > us it is also important the way you "write" these things... for example,
> > > with Chalten/Aconcagua you can write:
> > >
> > > 5 * month ---> Equivalent to 5 * (CalendarDuration months: 1)
> > > 5 * meter / (second * second) --> A measure of acceleration if you
> create
> > > meter as a unit using Aconcagua
> > > 1/10 * year --> Represents an interest rate of 10% yearly.
> > >
> > > As you can see, time measure are not only related only to the time
> domain
> > > but used in other domains... that is way for us it is important to
> support
> > > this type of behavior and in a DSL way...
> > >
> > > Bye,
> > > Hernan.
> > >
> > > > > 5) And of course, I like Chalten's model more that Chronos :-). For
> me
> > > it is
> > > > > easier to use, but this is just a matter of taste...
> > > > >
> > > > > There is a paper we wrote 2 years ago about the problems that the
> > > Smalltalk
> > > > > date classes have and the advantages of having a better model. If
> you
> > > are
> > > > > interested on having better date and time classes, I recommend you
> to
> > > read
> > > > > the paper... you may not like it, but at least you will see other
> people
> > > > > ideas...
> > > > > We use that model (Chalten) in a production system and we believe it
> > > allowed
> > > > > us to avoid many common mistakes related to financial systems....
> but
> > > hey,
> > > > > that's just a feeling, nothing I can prove formally.
> > > > >
> > > > > I hope you can do something useful.
> > > > > Bye,
> > > >
> > > > Chronos is a bit ugly in Squeak because Squeak does not support
> > > > namespaces which means that classes that model the same concept as
> > > > Squeak Chronology classes have different names (unless you mess with
> > > > shared pools). Also loading it is a bit of a pain with Monticello
> > > > (this is the fault of Monticello and not Chronos).
> > > >
> > > > Cheers
> > > > Philippe
> > > >
> > > > > Hernan.
> > > > >
> > > > >
> > > > > On 4/16/07, J J <[hidden email] > wrote:
> > > > > > I have looked at Cronos but it is really huge, and the classes
> that
> > > come
> > > > > > with the image are already very close.  I will have to look at
> > > Chalten,
> > > > > but
> > > > > > what is wrong with a few upgrades to the classes that come with
> > > Squeak?
> > > > > >
> > > > > > >From: "Hernan Wilkinson" < [hidden email]>
> > > > > > >Reply-To: The general-purpose Squeak developers
> > > > > > >list< [hidden email] >
> > > > > > >To: "The general-purpose Squeak developers
> > > > > > >list"< [hidden email] >
> > > > > > >Subject: Re: Date classes
> > > > > > >Date: Mon, 16 Apr 2007 14:28:09 -0300
> > > > > > >
> > > > > > >Before doing something with Date, I recommend you to take a look
> at
> > > > > > >"Chalten" or "Cronos". Chalten is in SqueakSource.... I think
> Cronos
> > > too.
> > > > > > >
> > > > > > >Hernan.
> > > > > > >
> > > > > > >On 4/16/07, J J < [hidden email]> wrote:
> > > > > > >>
> > > > > > >>Hi all,
> > > > > > >>
> > > > > > >>I am doing some stuff with dates and I noticed the date classes
> that
> > > > > come
> > > > > > >>with the default Squeak image are very nice and very close to
> having
> > > > > > >>everything I would want.  But there are a few inconsistencies
> here
> > > and
> > > > > > >>there, and things missing that would make things easier.
> > > > > > >>
> > > > > > >>So what is the procedure to updating this?  I think it's part of
> the
> > > > > core
> > > > > > >>system so I probably can't just do a monicello package update
> > > > > > >>somewhere?  Do
> > > > > > >>I have to do it through mantis?
> > > > > > >>
> > > > > > >>Thanks,
> > > > > > >>Jason
> > > > > > >>
> > > > > >
> > > > >
> > >
> >>_________________________________________________________________
> > > > > > >>Download Messenger. Join the i'm Initiative. Help make a
> difference
> > > > > today.
> > > > > >
> > > > >
> > >
> >>http://im.live.com/messenger/im/home/?source=TAGHM_APR07
> > > > > > >>
> > > > > > >>
> > > > > > >>
> > > > > >
> > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > >
> _________________________________________________________________
> > > > > > Get a FREE Web site, company branded e-mail and more from
> Microsoft
> > > Office
> > > > > > Live!
> > > > >
> > >
> http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Date classes

keith1y
In reply to this post by Ramon Leon-5

> Hey, Seaside rocks, hard!  Don't let anyone tell you otherwise or make you
> feel bad because of a lack of comments.  Comments are nice, but features are
> nicer.  You guys do outstanding work, even if it's not said enough, we're
> all thinking it.
>
> Ramon Leon
> http://onsmalltalk.com
"But if it is not documented it may as well not exist" - so the features
you mention that are so great actually for real purposes (apart from
personal hacking) do not exist!

When you are working in a professional coding environment, anything
without documentation falls below the radar. Management cant keep
looking at source code to see if a needed feature has arrived.

best regards

Keith

123