foreach syntax, std.mixin
Bill Baxter
wbaxter at gmail.com
Mon Nov 9 10:55:44 PST 2009
On Mon, Nov 9, 2009 at 6:46 AM, dsimcha <dsimcha at yahoo.com> wrote:
> == Quote from Bill Baxter (wbaxter at gmail.com)'s article
>> I agree. Those numbers don't seem so bad, particularly if inlining is
>> possible in the future.
>> But there's still the issue of how to get both an enumeration and an
>> unpacked tuple together.
>> --bb
>
> Yeah, I thought about this, and I didn't have any good answer other than make an
> absurdly baroque enumerateUnpack function. I'd be open to suggestions here.
unpack2nd(enumerate(zip(foo,bar))) ? :-P
or more seriously, you could have a flatten() type of HOF, which
flattens any tuples at the top level. So (1, Tuple(a,Tuple(b,c)))
becomes (1,a,Tuple(b,c)).
--bb
More information about the Digitalmars-d
mailing list