Testing for template argument being result of takeExactly

Jonathan M Davis jmdavisProg at gmx.com
Sat Sep 22 18:37:47 PDT 2012


On Sunday, September 23, 2012 02:57:36 bearophile wrote:
> Jonathan M Davis:
> > So, clearly I don't have the is expression right, and this is
> > seriously pushing the edge of my knowledge of is expressions.
> > So, any help would be appreciated. Thanks.
> 
> I have done some tries, but I have failed, I am sorry :-)
> The is() syntax is a part of D good to burn on a campfire.

The power that it provides is useful if not outright necessary, but it could 
definitely use some improvements in the usability camp once you go beyond the 
basics. But I don't even know how you'd go about designing it so that it was 
more user friendly.

> But takeExactly returns a Result struct defined inside it, so it
> even possible for the is() syntax to work on this inner (hidden?)
> type? Generally the idea of defining structs inside looks nice,
> but seems a source for troubles.

Yeah. Increasingly, it looks like Voldemort types are a bad idea as nice as 
they are in principle. But we have yet to reach the point where it's clear 
that we need to ditch them. We may yet get there though.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list