The new, new phobos sneak preview
bearophile
bearophileHUGS at lycos.com
Fri Apr 10 17:16:05 PDT 2009
Andrei Alexandrescu:
> Then please vote up my comment which shows a solution that is simple
> *and* efficient :o).
I am not registered there, so I can't vote, I guess.
Generally I don't like reduce() HOF, because it generally leads to less readable code (and often people use it only to compute a sum or product of items), but this time it's a good enough usage.
You have forgotten to compute the average, as requested by the original article.
Regarding field access:
assert(r.field[0] == 2); // minimum
assert(r.field[1] == 11); // maximum
I've found that sometimes a shorter syntax is nice, I use d0, d1, etc:
assert(r.d0 == 2);
assert(r.d1 == 11);
(It doesn't replace the general [] access).
>I've developed a skepticism towards arxiv.org. My understanding is that it's not high-quality so a paper that only appears of it is highly questionable.<
There some papers are very good, and some papers are ugly. I generally mostly care for the contents, so I like that source of knowledge.
Bye,
bearophile
More information about the Digitalmars-d
mailing list