On Thu, 05 Jun 2014 18:15:11 -0400 Steven Schveighoffer via Digitalmars-d <[email protected]> wrote:
> Respectfully disagree, the API looks very good to me. And decidedly > not C-like. It's not even _possible_ to write a function like this in C or in C++98 (though - though maybe C++11/14 can). I don't know of any other language where a function like this can exist. I think that it's actually a great example of what you can do with D, and it's implementation not shows off a number of basic features, but it's simple enough that it's not at all hard to understand in spite of how fancy what it's doing is. I've never seen another language that had metaprogramming language capabilities as simple and powerful as this. Sure, you could argue that having the function take ref instead of pointers would be better (though that's debatable) and that using pointers instead of ref is too C-like, but since you unfortunately can't actually have variadic template arguments which are ref, we're stuck with pointers for that overload of split even if we would have wanted to do it differently. getopt is in the same boat, so it's already doing what some other important D functions do. - Jonathan M Davis
