[squeak-dev] Status of date problem

Bert Freudenberg bert at freudenbergs.de
Sat Mar 19 15:58:48 UTC 2016


On 19.03.2016, at 16:38, Chris Muller <asqueaker at gmail.com> wrote:
> 
> Woops, I see I made a typo, I said I wish to keep #nowWithOffset:, but
> in fact, that's the one you (rightfully) deprecated.  #nowAtOffset: is
> the new one which I wish to keep.

Yes that’s the one I meant.

> Your concern seems to be either about the size of the API, or the
> rightness of having #nowAtOffset: as a constructor.
> 
> My interest is for the API to be conventional and consistent, and by
> that, I mean, the user should expect to be able to interact strictly
> with the constructor methods to obtain the instance they want, as is
> the case with all value objects, and not have to create an interim
> instance first.

Okay, having that method as a possible optimization point is an argument in favor.

If you’re touching this, would you mind changing the implementation to this?

	^self now utcOffset: offsetDuration

And we should think about deprecating utcOffset: and renaming it to ... atOffset:?

> I actually think we should get rid of DateAndTime>>#offset:, or at
> least make it a private (or initializing) method.

+1

(if we deprecate it, we need to adjust the message in nowWithOffset:)

> Finally, DateAndTime class>>#now:offset: should be made private.  Its
> private, right?

Yes, making it private sounds right.

- Bert -



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4207 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20160319/fa034423/smime.bin


More information about the Squeak-dev mailing list