Is D a cult?

BCS none at anon.com
Tue Mar 9 15:02:00 PST 2010


Hello retard,

> Lists can also be infinite in lazy languages so [1..$] makes little
> sense. So the example was a bit misleading. But if you see how lists
> are implemented with algebraic types, you might also see how other
> structures like trees (list is a degenerated tree) are matched.

The points you bring up I think support NOT adding this to D because there 
are so many cases that supporting them all in the language would get to messy.

The most general case I think would work is, when the switch type is a user 
defined type, to allow any literal as the case labels as long as the switch 
type defines == for it and then require that the only one case compare as 
equals. With that requirement, the optimizer might be able to inline and 
fold a LOT of code in some cases.

-- 
... <IXOYE><






More information about the Digitalmars-d mailing list