Associative Arrays with elements having function type?

Paul Backus snarwin at gmail.com
Wed Nov 12 15:49:48 UTC 2025


On Tuesday, 11 November 2025 at 17:58:33 UTC, Quirin Schroll 
wrote:
> There’s a big difference between a function type and a function 
> pointer type. (I don’t know why D even has function types. 
> Borderline useless.)

Probably so that the frontend can model function pointer types as 
a `TypePointer` whose `.next` member is a `TypeFunction`, instead 
of having a dedicated `TypeFunctionPointer` class.

It's the kind of thing that sounds clever and elegant when you 
first think of it, so you implement it, only to discover much 
later that it actually causes more trouble than it solves. But by 
then it's too late to take it out.

Many such cases in D, unfortunately.


More information about the Digitalmars-d mailing list