Re: Trying to reproduce Node.js async waterfall pattern.. (Meta-programming)

2014-06-23 Thread Christian Beaumont via Digitalmars-d-learn
Just an idea that popped into my head... Maybe I can use variant for the input/output types? I haven't looked at it yet, so I'm not sure what it does, or the performance costs. I realized that because the final callback always gets called, and the types of the intermediate steps may be differ

Re: Trying to reproduce Node.js async waterfall pattern.. (Meta-programming)

2014-06-23 Thread Christian Beaumont via Digitalmars-d-learn
Just to be sure: whether or not an error is passed to a callback, the final callback is always called? I mean, the last callback could also be called *only when something fails*, a bit like a default case in a switch, or an error-handling routine. Yes, the final callback is always called, bu

Trying to reproduce Node.js async waterfall pattern.. (Meta-programming)

2014-06-23 Thread Christian Beaumont via Digitalmars-d-learn
Hi, I just started learning D, and thought I'd throw myself in at the deep end with some meta-programming, trying to write the equivalent of the commonly used, async waterfall, and also, because I'd like to use it... If you aren't familiar with it, waterfall is a function that is passed a s