<br><br><div><span class="gmail_quote">On 4/18/07, <b class="gmail_sendername">Philippe Marschall</b> <<a href="mailto:philippe.marschall@gmail.com">philippe.marschall@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2007/4/17, Hernan Wilkinson <<a href="mailto:hernan.wilkinson@gmail.com">hernan.wilkinson@gmail.com</a>>:<br>><br>><br>> On 4/17/07, Philippe Marschall <<a href="mailto:philippe.marschall@gmail.com">philippe.marschall@gmail.com
</a>> wrote:<br>> > You said:<br>> > > 5) Chalten is based on a arithmetic model that allows you to represent<br>> time measurements easily (like 3 days, 5 months, etc)<br>> ><br>> > So I assumed you meant we could write
<br>> > 5 months<br>> > just the same way we could write<br>> > 100 dollars<br>> > like the examples in the paper show.<br>><br>> No "5 months" but "5 * months" or "moth with: 5". Same for "dollars",
<br>> "euros", "meters", "liters", "A", "B", etc.<br>> That is why I think that measure was not a good word to define this<br>> objects... 5*A is not a measure.. what we implemented is really an algebra,
<br>> maybe a limited one, but an algebra at the end.<br><br>Maybe I'm just seeing things:<br><a href="http://www.iam.unibe.ch/~ducasse/Teaching/CoursAnnecy/0506-M1-COO/A%20New%20Object-Oriented%20Model%20of%20the%20Gregorian%20Calendar.pdf">
http://www.iam.unibe.ch/~ducasse/Teaching/CoursAnnecy/0506-M1-COO/A%20New%20Object-Oriented%20Model%20of%20the%20Gregorian%20Calendar.pdf</a><br>page 7, figure 11:<br>14 days + 1 week = 1814400000 milliseconds. "Adding measurements of
<br>the same base unit"<br>((14 days + 1 week) convertTo: days) = 21 days. "Converting the result<br>of an operation"<br>(1 year + 10 days) = (1 year + 10 days) "Adding measurements of<br>different base unit"
<br>10 years * 10 = 100 years "Multiplying a measurement by a number"<br>10 years * 12 months = 10 year*year "Multiplying measurements"<br>10 years * 12 months / 24 months = 5 years "The model automatically
<br>simplifies units"<br>100 kilometers / 1 hour "Represents a speed of 100 km per hour"<br>0.01 / 1 month "Represent an interest rate of 10 % by month"<br><br>page 8, figure 12:<br>(GregorianYear number: 2005) next: 1 year "Returns GregorianYear number: 2006"
<br>(GregorianYear number: 2005) next: 12 months "Returns GregorianYear<br>number: 2006"<br>(GregorianYear number: 2005) next: 10 years "Returns GregorianYear number: 2015"<br>(GregorianYear number: 2005) previous: 5 years "Returns GregorianYear
<br>number: 2000"<br><br>page 8, figure 13:<br>(GregorianYear number: 2005) next: 120 days "Signals an exception<br>because 120 days can not be<br>converted to years"<br>'01/2005' asGregorianMonthOfYear next: 120 days "Signals an exception
<br>because 120 days can not be<br>converted to months"<br><br>page 8, figure 14:<br>GregorianDay monday next: 4 days "Returns Friday"<br>GregorianMonth january next: 2 months "Returns March"<br>(GregorianMonth january dayNumber: 1) next: 2 days "Returns January 3rd "
<br><br>page 8, figure 17:<br>"Returns an Interval with six elements, the years<br>2005,2007,2009,2011,2013 and 2015 inclusive".<br>(GregorianYear number: 2005) to: (GregorianYear number: 2015) by: 2 years<br>"Returns an Interval with six elements, the years
<br>2005,2004,2003,2002,2001 and 2000 inclusive".<br>(GregorianYear number: 2005) to: (GregorianYear number: 2000) by: -1 year<br><br>page 10, figure 22:<br>"06/01/2005 is a Thursday"<br>aTimespan := Timespan from: '06/01/2005' asGregorianDate duration: 48 hours.
</blockquote><div><br>ups... you are right, the papers were written before we implemented the #* message to create measures... that's why documentation is not good! :-) (Hey, just kidding, I don't want to get into that discussion again...)
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> > > > And there is still the question where year comes from<br>> > > > (please no shared pool).
<br>> > ><br>> > > I did not see that question, but the answer is No. The variable "year"<br>> is<br>> > > global. The same as month, day, January, February, Monday, etc. Maybe<br>
> you<br>> > > will not like it,<br>> ><br>> > Global state sucks, no matter how well intended. I haven't tested it<br>> > but I wouldn't be surprised if it causes problems with Monticello.
<br>><br>> Well, I do not agree... I used to think like that but I've changed my<br>> mind... Object should be global if the entity they represent in real life is<br>> global... but I understand that you don't like them.
<br>> From an Software Engineering point of view, global variables are not good...<br>> but if you think software development as a learning process and you see the<br>> Smalltalk image as the "state" of your knowledge about a specific domain(s),
<br>> having global objects (well know objects) is not bad....<br>><br>> > > but I think that the time domain is so important in<br>> > > writing software as the arithmetic domain,<br>> ><br>
> > I think time sucks as a domain. Days that don't have 24 hours, minutes<br>> > that don't have 60 seconds, years that don't have 365 days, different<br>> > calendars, timezones, points in time with timezones and without
<br>> > timezones, timezones with more than two DST changes, different week<br>> > start days, .... For every rule there's an exception and these can<br>> > change at basically any time. Seriously, how much worse can it get?
<br>><br>><br>> I believe it is a really interesting domain!! because of the things you<br>> mention! because the exceptions it has makes it a very interesting and<br>> challenging problem to design.<br><br>
Well, yeah. I just don't see how Chalten addresses many of these. Eg.<br>it assumes days have 24 hours and minutes have 60 seconds.</blockquote><div><br>Yes, as I said, it is a model of the GREGORIAN CALENDAR, and in that calendar, days have 24 hours and minutes 60 seconds...
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> > > so if numbers are global (1, 2,<br>> > > 3, etc) why not the time objects? They are well know entities of the
<br>> real<br>> > > life....<br>> ><br>> > Numbers are literals not global variables.<br>><br>> Well... that's an implementation detail... at the end they are global. They<br>> are not "global variables" but "global objects" because the parser knows
<br>> about them.... so, at the end, they are global. And I think it is ok for<br>> them to be global because it is almost impossible to think about a<br>> programming language without numbers.... when we get a programming language
<br>> we are expecting to have at least the math to be model with it... (a<br>> programming language without numbers as primitives is a very challenging<br>> idea... I don't know if it is feasible...)<br><br>
I don't agree because they don't have the semantics of globals like<br>identify (for everything but SmallIntegers). </blockquote><div><br>I don't understand this... anyhow, at the end, from a conceptual point of view, they are global objects (no global variables... I see variables just as names we give to objects...)
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The compiler/parser knows<br>about them, that's all. But that certainly depends of POV.
</blockquote><div><br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> Anyhow, I think that when your knowledge about a problem domain (Smalltalk
<br>> image) is mature, you will end up with some global objects... We develop<br>> financial software and I have to tell you that having "dollar", "euro", etc.<br>> as global objects would help us a lot... for example no need to declare them
<br>> on each unit test (of course we use test resources, but still), no need for<br>> the final user to define them (they expect dollar, euro, peso, etc. as part<br>> of the "kit")...<br><br>Why don't you have them as global objects then?
</blockquote><div><br>Because software evolution is not simple you know... and because not everybody in the team agrees with me!!! :-).<br><br>Well, it was nice to talk about this issues with you. <br><br>Bye,<br>Hernan.
<br><br> <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Cheers<br>Philippe<br><br>> Bye,<br>> Hernan.<br>><br>> > Cheers
<br>> > Philippe<br>> ><br>> > > Bye,<br>> > > Hernan.<br>> > ><br>> > ><br>> > > > Cheers<br>> > > > Philippe<br>> > > ><br>> > > > >
<br>> > ><br>> <a href="http://portal.acm.org/citation.cfm?id=1094964&coll=ACM&dl=ACM&CFID=20205775&CFTOKEN=19800555">http://portal.acm.org/citation.cfm?id=1094964&coll=ACM&dl=ACM&CFID=20205775&CFTOKEN=19800555
</a><br>> > > > > )<br>> > > > ><br>> > > > > Hope this help.<br>> > > > > Hernan.<br>> > > > ><br>> > > > > > Cheers<br>> > > > > > Philippe
<br>> > > > > ><br>> > > > > > > > > These objects are<br>> > > > > > > > > polymorphic with numbers respect to the arithmetic messages<br>> such<br>
> > > as<br>> > > > > +,<br>> > > > > > > -, *,<br>> > > > > > > > > etc., that means that you can use them in arithmetic<br>> formulas<br>> > > > > > > >
<br>> > > > > > > > That's true to a certain extent in Chronos for example you<br>> can:<br>> > > > > > > > Timepoint now - (CalendarDuration months: 1)<br>> > > > > > > > (CalendarDuration months: 1) * 5
<br>> > > > > > > > but you can't:<br>> > > > > > > > 5 * (CalendarDuration months: 1)<br>> > > > > > ><br>> > > > > > > Ok, but it is not only the functionality what it is important
<br>> for<br>> > > us...<br>> > > > > for<br>> > > > > > > us it is also important the way you "write" these things... for<br>> > > example,<br>> > > > > > > with Chalten/Aconcagua you can write:
<br>> > > > > > ><br>> > > > > > > 5 * month ---> Equivalent to 5 * (CalendarDuration months: 1)<br>> > > > > > > 5 * meter / (second * second) --> A measure of acceleration if
<br>> you<br>> > > > > create<br>> > > > > > > meter as a unit using Aconcagua<br>> > > > > > > 1/10 * year --> Represents an interest rate of 10% yearly.<br>
> > > > > > ><br>> > > > > > > As you can see, time measure are not only related only to the<br>> time<br>> > > > > domain<br>> > > > > > > but used in other domains... that is way for us it is important
<br>> to<br>> > > > > support<br>> > > > > > > this type of behavior and in a DSL way...<br>> > > > > > ><br>> > > > > > > Bye,<br>> > > > > > > Hernan.
<br>> > > > > > ><br>> > > > > > > > > 5) And of course, I like Chalten's model more that Chronos<br>> :-).<br>> > > For<br>> > > > > me<br>> > > > > > > it is
<br>> > > > > > > > > easier to use, but this is just a matter of taste...<br>> > > > > > > > ><br>> > > > > > > > > There is a paper we wrote 2 years ago about the problems
<br>> that<br>> > > the<br>> > > > > > > Smalltalk<br>> > > > > > > > > date classes have and the advantages of having a better<br>> model.<br>> > > If
<br>> > > > > you<br>> > > > > > > are<br>> > > > > > > > > interested on having better date and time classes, I<br>> recommend<br>> > > you<br>> > > > > to
<br>> > > > > > > read<br>> > > > > > > > > the paper... you may not like it, but at least you will see<br>> > > other<br>> > > > > people<br>> > > > > > > > > ideas...
<br>> > > > > > > > > We use that model (Chalten) in a production system and we<br>> > > believe it<br>> > > > > > > allowed<br>> > > > > > > > > us to avoid many common mistakes related to financial
<br>> > > systems....<br>> > > > > but<br>> > > > > > > hey,<br>> > > > > > > > > that's just a feeling, nothing I can prove formally.<br>> > > > > > > > >
<br>> > > > > > > > > I hope you can do something useful.<br>> > > > > > > > > Bye,<br>> > > > > > > ><br>> > > > > > > > Chronos is a bit ugly in Squeak because Squeak does not
<br>> support<br>> > > > > > > > namespaces which means that classes that model the same<br>> concept as<br>> > > > > > > > Squeak Chronology classes have different names (unless you
<br>> mess<br>> > > with<br>> > > > > > > > shared pools). Also loading it is a bit of a pain with<br>> Monticello<br>> > > > > > > > (this is the fault of Monticello and not Chronos).
<br>> > > > > > > ><br>> > > > > > > > Cheers<br>> > > > > > > > Philippe<br>> > > > > > > ><br>> > > > > > > > > Hernan.
<br>> > > > > > > > ><br>> > > > > > > > ><br>> > > > > > > > > On 4/16/07, J J <<a href="mailto:azreal1977@hotmail.com">azreal1977@hotmail.com
</a> > wrote:<br>> > > > > > > > > > I have looked at Cronos but it is really huge, and the<br>> classes<br>> > > > > that<br>> > > > > > > come<br>> > > > > > > > > > with the image are already very close. I will have to
<br>> look at<br>> > > > > > > Chalten,<br>> > > > > > > > > but<br>> > > > > > > > > > what is wrong with a few upgrades to the classes that come
<br>> > > with<br>> > > > > > > Squeak?<br>> > > > > > > > > ><br>> > > > > > > > > > >From: "Hernan Wilkinson" < <a href="mailto:hernan.wilkinson@gmail.com">
hernan.wilkinson@gmail.com</a>><br>> > > > > > > > > > >Reply-To: The general-purpose Squeak developers<br>> > > > > > > > > > >list<<br>> <a href="mailto:squeak-dev@lists.squeakfoundation.org">
squeak-dev@lists.squeakfoundation.org</a><br>> > > ><br>> > > > > > > > > > >To: "The general-purpose Squeak developers<br>> > > > > > > > > > >list"<
<br>> <a href="mailto:squeak-dev@lists.squeakfoundation.org">squeak-dev@lists.squeakfoundation.org</a><br>> > > ><br>> > > > > > > > > > >Subject: Re: Date classes<br>> > > > > > > > > > >Date: Mon, 16 Apr 2007 14:28:09 -0300
<br>> > > > > > > > > > ><br>> > > > > > > > > > >Before doing something with Date, I recommend you to take<br>> a<br>> > > look<br>> > > > > at
<br>> > > > > > > > > > >"Chalten" or "Cronos". Chalten is in SqueakSource.... I<br>> think<br>> > > > > Cronos<br>> > > > > > > too.
<br>> > > > > > > > > > ><br>> > > > > > > > > > >Hernan.<br>> > > > > > > > > > ><br>> > > > > > > > > > >On 4/16/07, J J <
<a href="mailto:azreal1977@hotmail.com">azreal1977@hotmail.com</a>> wrote:<br>> > > > > > > > > > >><br>> > > > > > > > > > >>Hi all,<br>> > > > > > > > > > >>
<br>> > > > > > > > > > >>I am doing some stuff with dates and I noticed the date<br>> > > classes<br>> > > > > that<br>> > > > > > > > > come
<br>> > > > > > > > > > >>with the default Squeak image are very nice and very<br>> close<br>> > > to<br>> > > > > having<br>> > > > > > > > > > >>everything I would want. But there are a few
<br>> > > inconsistencies<br>> > > > > here<br>> > > > > > > and<br>> > > > > > > > > > >>there, and things missing that would make things easier.
<br>> > > > > > > > > > >><br>> > > > > > > > > > >>So what is the procedure to updating this? I think it's<br>> > > part of<br>> > > > > the
<br>> > > > > > > > > core<br>> > > > > > > > > > >>system so I probably can't just do a monicello package<br>> > > update<br>> > > > > > > > > > >>somewhere? Do
<br>> > > > > > > > > > >>I have to do it through mantis?<br>> > > > > > > > > > >><br>> > > > > > > > > > >>Thanks,
<br>> > > > > > > > > > >>Jason<br>> > > > > > > > > > >><br>> > > > > > > > > ><br>> > > > > > > > >
<br>> > > > > > ><br>> > > > ><br>> > ><br>> >>_________________________________________________________________<br>> > > > > > > > > > >>Download Messenger. Join the i'm Initiative. Help make a
<br>> > > > > difference<br>> > > > > > > > > today.<br>> > > > > > > > > ><br>> > > > > > > > ><br>> > > > > > >
<br>> > > > ><br>> > > >><br>> <a href="http://im.live.com/messenger/im/home/?source=TAGHM_APR07">http://im.live.com/messenger/im/home/?source=TAGHM_APR07</a><br>> > > > > > > > > > >>
<br>> > > > > > > > > > >><br>> > > > > > > > > > >><br>> > > > > > > > > ><br>> > > > > > > > > >
<br>> > > > > > > > > > ><br>> > > > > > > > > ><br>> > > > > > > > > ><br>> > > > > > > > ><br>> > > > > > >
<br>> > > > ><br>> > ><br>> _________________________________________________________________<br>> > > > > > > > > > Get a FREE Web site, company branded e-mail and more from
<br>> > > > > Microsoft<br>> > > > > > > Office<br>> > > > > > > > > > Live!<br>> > > > > > > > ><br>> > > > > > >
<br>> > > > ><br>> > ><br>> <a href="http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/">http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/</a><br>> > > > > > > > > >
<br>> > > > > > > > > ><br>> > > > > > > > > ><br>> > > > > > > > ><br>> > > > > > > > ><br>> > > > > > > > >
<br>> > > > > > > > ><br>> > > > > > > > ><br>> > > > > > > ><br>> > > > > > > ><br>> > > > > > ><br>
> > > > > > ><br>> > > > > > ><br>> > > > > > ><br>> > > > > > ><br>> > > > > ><br>> > > > > ><br>> > > > >
<br>> > > > ><br>> > > > ><br>> > > > ><br>> > > > ><br>> > > ><br>> > > ><br>> > ><br>> > ><br>> > ><br>> > >
<br>> > ><br>> ><br>> ><br>><br>><br>><br>><br>><br><br></blockquote></div><br>