[Fwd: Re: [go-nuts] Re: Generics false dichotomy]
Jesse Phillips
Jesse.K.Phillips+D at gmail.com
Tue Feb 18 07:21:04 PST 2014
On Tuesday, 18 February 2014 at 12:13:56 UTC, Tobias Pankrath
wrote:
> I have a hard time to subsume D's type system under parametric
> polymorphism, while I see how Javas generics may be. This may
> just be way over my head, but I'd rather say D has a
> sophisticated way of ad-hoc polymorphism that provides ways to
> generate overloads on demand, contrary to the wikipedia
> statement that ad-hoc only allows for a fixed amount of
> overloads.
"[ad hoc polymorphism] is also known as function overloading or
operator overloading[...] This is in contrast to parametric
polymorphism, in which polymorphic functions are written without
mention of any specific type."
For awhile I would have supported the claim that Go has
parametric polymorphism, but "while still maintaining full
*static* type-safety" prevents that.
More information about the Digitalmars-d
mailing list