Any ideas for lazy evaluation on varaible argument functions?
BCS
BCS at pathlink.com
Fri Oct 19 14:17:56 PDT 2007
Darryl B wrote:
> == Quote from BCS (ao at pathlink.com)'s article
>
>>make .info look like this
>>infoV(A...)(lazy A a){
>> this.info(arg.format(a));
>>}
>>that (or somthing like it) should work
>
>
> Hmm, I think that works to preserve the laziness, but it's not really any cleaner
> to do:
>
> t.infoV!(char[], char[])("{}", expensiveFunction());
> or
> t.infoV!(char[], int, float, char[])("{}, {}, {}", intFunc(), floatFunc(),
> charFunc());
>
> Than it is to do:
>
> t.info(t.format("{}", expensiveFunction()));
> or
> t.info(t.format("{}, {}, {}", intFunc(), floatFunc(), charFunc()));
>
> Unless I'm misunderstanding what you're saying?
it helps in the less typing area.
also this should work
t.infoV("{}", expensiveFunction());
or
t.infoV("{}, {}, {}", intFn(), floatFn(), charFn());
More information about the Digitalmars-d
mailing list