Pattern matching is-expressions

H. S. Teoh hsteoh at
Wed Aug 19 15:51:01 UTC 2020

On Wed, Aug 19, 2020 at 01:37:54PM +0000, Dennis via Digitalmars-d wrote:
> If D were to be rebuilt from the ground up with first-class types, things
> could definitely be simplified.

In an ideal world, types would be first class entities that you can pass
around and manipulate at will.  Inside templates / CTFE, operations on
types would operate directly on the compiler's internal type
representation.  If any of these types end up in runtime code, they are
replaced with runtime equivalents (typeid, et al).  The same
type-manipulating function would be usable both at CTFE and at runtime,
with the same semantics.

Of course, this idealistic scenario may not be very realistic, but
moving in its direction could unify quite a number of currently
divergent constructs, simplify the language, yet increase expressivity.


The best way to destroy a cause is to defend it poorly.

More information about the Digitalmars-d mailing list