The Inbox: Collections-cbc.604.mcz

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

The Inbox: Collections-cbc.604.mcz

commits-2
A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-cbc.604.mcz

==================== Summary ====================

Name: Collections-cbc.604
Author: cbc
Time: 6 March 2015, 3:44:37.262 pm
UUID: 0513e699-e650-2340-8505-70e368dd9c64
Ancestors: Collections-eem.603, Collections-cbc.582

Changes to support adding and subtracting strings from DateAndTimes.  Supports syntax such as:
DateAndTime now + '02:00:00:00'
and
DateAndTime now - '02:00:00:00'

=============== Diff against Collections-eem.603 ===============

Item was added:
+ ----- Method: String>>addToDateTime: (in category 'arithmetic') -----
+ addToDateTime: aDateAndTime
+ "Utilized when adjusting DateAndTimes.  Such as:
+ DateAndTime now + '02: 00:00:00'
+ Not expected to be used outside of that system."
+ ^self asDuration addToDateTime: aDateAndTime
+ !

Item was added:
+ ----- Method: String>>subtractFromDateTime: (in category 'arithmetic') -----
+ subtractFromDateTime: aDateAndTime
+ "Utilized when adjusting DateAndTimes.  Such as:
+ DateAndTime now - '02: 00:00:00'
+ Not expected to be used outside of that system."
+ ^self asDuration subtractFromDateTime: aDateAndTime
+ !


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Collections-cbc.604.mcz

Chris Muller-3
String casting is typically used to get data into a system, wouldn't
it be better for that interface to do the String casting than adding
methods to String?

On Fri, Mar 6, 2015 at 5:44 PM,  <[hidden email]> wrote:

> A new version of Collections was added to project The Inbox:
> http://source.squeak.org/inbox/Collections-cbc.604.mcz
>
> ==================== Summary ====================
>
> Name: Collections-cbc.604
> Author: cbc
> Time: 6 March 2015, 3:44:37.262 pm
> UUID: 0513e699-e650-2340-8505-70e368dd9c64
> Ancestors: Collections-eem.603, Collections-cbc.582
>
> Changes to support adding and subtracting strings from DateAndTimes.  Supports syntax such as:
> DateAndTime now + '02:00:00:00'
> and
> DateAndTime now - '02:00:00:00'
>
> =============== Diff against Collections-eem.603 ===============
>
> Item was added:
> + ----- Method: String>>addToDateTime: (in category 'arithmetic') -----
> + addToDateTime: aDateAndTime
> +       "Utilized when adjusting DateAndTimes.  Such as:
> +               DateAndTime now + '02: 00:00:00'
> +       Not expected to be used outside of that system."
> +       ^self asDuration addToDateTime: aDateAndTime
> + !
>
> Item was added:
> + ----- Method: String>>subtractFromDateTime: (in category 'arithmetic') -----
> + subtractFromDateTime: aDateAndTime
> +       "Utilized when adjusting DateAndTimes.  Such as:
> +               DateAndTime now - '02: 00:00:00'
> +       Not expected to be used outside of that system."
> +       ^self asDuration subtractFromDateTime: aDateAndTime
> + !
>
>