Proposal: Dedicated-string-mixin templates/functions

Chad J chadjoan at __spam.is.bad__gmail.com
Sat Feb 6 08:10:15 PST 2010


Nick Sabalausky wrote:
> ...
> 
> But yea, that's is still a good point. Although I think it might be better 
> considered part of the more general problem of passing code literals (even 
> though it's as delegates in one case and as strings in the other). For 
> instance, even without any mixins involved, we still have this kind of mess:
> 
> void repeat(int num, 
> IForgetTheSyntaxOffhandButLetsJustSayADgThatTakesVoidAndReturnsVoid dg)
> {
>     for(int i; 0..num)
>         dg();
> }
> 
> // Eeew:
> repeat(3,
> {
>     // Stuff here
> });
> 
> 

Yep.  My thoughts exactly.



More information about the Digitalmars-d mailing list