This one time, at band camp, O Plameras wrote:
>Jamie Wilkinson wrote:
>>This one time, at band camp, O Plameras wrote:
>>  
>>>Andre Pang wrote:
>>>    
>>>> "foo" + 5
>>>>      
>>>What about,
>>>
>>>today + 1  =  14 Sept 2006 if today is 13 Sept 2006
>>>or
>>>time +1 = 5pm if time is 4pm
>>>
>>>For me this is just fine. Makes coding easy and fast.
>>>    
>>
>>Unless you don't know that 1 unit is a day; or you wanted to add a second,
>>or a minute, or a year!
>Are you being cynical or silly ?
>
>We are talking  'overloading'. 'Overloading' is the interpreter's 
>ability to know
>different meanings for the same 'term' or 'label' depending on the 
>context or
>value of the variable.  Is'nt this, also, the context of this thread, 
>namely, the
>debate on the pitfalls and the power of 'overloading' ?

You've said "let's overload plus for time to mean we add a whole day".
Andre and myself have said "picking 'one day' for what adding an integer to
a time means is arbitraty and unobvious to anyone but the person who first
decided it."

Yes, you can overload plus to let you easily add integers to time types.

I'm strongly of the opinion that time types are not good types to overload
like this.

Cynical, yes; silly, no.
_______________________________________________
coders mailing list
[email protected]
http://lists.slug.org.au/listinfo/coders

Reply via email to