Bug: DST 6 Date class>>#newDay:monthNumber:year:

Bug: DST 6 Date class>>#newDay:monthNumber:year:

Post by Udo Schnei » Fri, 14 Nov 2008 05:32:32


While porting some seaside stuff I stumbled over a bug in Date
class>>#newDay:monthNumber:year:

Simply try "Date newDay: 31 monthNumber: 3 year: 1977" which fails.

The fix is pretty simple:
newDay: dayNumber monthNumber: monthNumber year: yearNumber
^self
newDay: dayNumber
monthIndex: monthNumber
year: yearNumber

Didn't check this in DST6.1 though.

CU,

Udo
 
 
 

Bug: DST 6 Date class>>#newDay:monthNumber:year:

Post by Joachim Tu » Fri, 14 Nov 2008 14:59:21

Udo,

you don't mention what error you get here in Dolphin. I only remember
stumbling upon this difference when I had to port code form VisualWorks
to VA Smalltalk. One of the implements newDay:monthIndex:year: and the
other one has newDay:monthNumber:year:. That's a difference you can
handle, but it makes life harder than it shoud be. So it seems Dolphin
supports newDay:monthIndex:year: ...

Joachim


Udo Schneider schrieb:

 
 
 

Bug: DST 6 Date class>>#newDay:monthNumber:year:

Post by Udo Schnei » Fri, 14 Nov 2008 16:07:22

All,

Dolphin supports both methods. However #newDay:monthIndex:year: is the
intended method and #newDay:monthNumber:year: is for VW compatibility.

I'm not sure anymore whether it's a bug as a clean image as the correct
implementation. Somehow my working image got the wrong code and I can
not track down why. Neither does STS know something nor is the Package
itself changed .... very strange.

CU,

Udo
 
 
 

Bug: DST 6 Date class>>#newDay:monthNumber:year:

Post by Udo Schnei » Fri, 14 Nov 2008 17:18:21

Dolphin supports both methods. However #newDay:monthIndex:year: is the
intended method and #newDay:monthNumber:year: is for VW compatibility.

I'm not sure anymore whether it's a bug as a clean image as the correct
implementation. Somehow my working image got the wrong code and I can
not track down why. Neither does STS know something nor is the Package
itself changed .... very strange.

CU,

Udo
 
 
 

Bug: DST 6 Date class>>#newDay:monthNumber:year:

Post by Jano » Fri, 14 Nov 2008 19:07:47

...
...

in D61 it gives back a Date as Thursday, March 31, 1977
Janos