function overload on full signature?

foobar foo at bar.com
Thu Nov 15 08:18:43 PST 2012


On Wednesday, 14 November 2012 at 19:12:59 UTC, Timon Gehr wrote:
> On 11/14/2012 06:43 PM, foobar wrote:
>> On Tuesday, 13 November 2012 at 21:34:28 UTC, Rob T wrote:
>>> I'm wondering why overloading has been implemented to only 
>>> match on
>>> the argument list rather than the full signature which 
>>> includes the
>>> return type? I know I would use it if it was available.
>>>
>>> I'm not requesting this to be a feature of D, I'm only asking 
>>> why it
>>> is not being done.
>>>
>>> --rt
>>
>> This is hardly a new idea. It was implemented in a few 
>> languages of the
>> 70's and it proved to be adding complexity and generally not 
>> worth the
>> trouble.
>
> I guess they just were not doing it right then.
>
>> No language nowadays bothers with this based on those past 
>> lessons.
>
> Haskell.
>
> > fromInteger 2 :: Float
> 2.0

I thought that Haskell doesn't have function overloading (which 
simplifies this greatly)... Anyway, I mostly meant "standard" 
imperative/OO languages. Sorry for the confusion.


More information about the Digitalmars-d mailing list