On 8/7/2012 7:15 AM, Philippe Sigaud wrote:
Also, what I proposed was a *static* decision: with SkipErrors { no, yes }. With a static if inside its guts, the lexer could change its behavior accordingly.
Yes, I understand about static if decisions :-) hell I invented them!
Walter, with all due respect, you sometimes give the impression to forget we are talking about D and go back to deeply entrenched C-isms.
Delegates are not C-isms.
Compile-time decisions can be used to avoid any overhead as long as you have a clear idea of what the two code paths should look like.
Yes, I understand that. There's also a point about adding too much complexity to the interface. The delegate callback reduces complexity in the interface.
And, as Christophe said, ranges are a powerful API. In another thread Simen and me did some comparison between C-like code and code using only ranges upon ranges upon ranges. A (limited!) difference in speed appeared only for very long calculations.
That's good, and you really don't need to sell me on ranges - I'm already sold.