Article: Writing Julia style multiple dispatch code in D

data pulverizer via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Aug 30 13:05:11 PDT 2017


On Wednesday, 30 August 2017 at 18:48:58 UTC, data pulverizer 
wrote:
> I suspect the reason you can't have parametric typed array 
> containers in statically typed compiled languages is that 
> underneath, they are doubly/linked lists, and there is no way 
> of resolving the types at the end of the array, and allowing 
> appending at the same time ... someone correct me if I am wrong.

The only other way would be to create a wrapper interface and 
classes for each type you want to include in the array, which 
takes you back to sub-type (OOP) polymorphism.


More information about the Digitalmars-d-announce mailing list