What is the reasoning behind the lack of conversions when passing parameters

monkyyy crazymonkyyy at gmail.com
Sat Feb 3 23:04:39 UTC 2024


On Saturday, 3 February 2024 at 18:53:02 UTC, Carl Sturtivant 
wrote:
> 
> Was the idea of an `overload` keyword ever considered for D?

What do you have against overloading?

Breaking overloading would kill d, just unironically; how 
templates even exist is fundamentally about overloading, and the 
rabbit hole of overloading is rich and wonderful.

I want function overloading to be 90% of all features in a 
language; and what auto-promotion rules d has is already to much 
and breaks overloading for example an overload set containing 
`foo(int[3])` and `foo()(string)` when matched to `foo("foo")` or 
something like it matches insanely to the int[3] in some cases.

If you want a highly polymorphic function grab some of the 
example metaprogramming code and just alias


More information about the Digitalmars-d mailing list