How to implement predicates for Filter!(Pred, Tuple)
David Nadlinger
see at klickverbot.at
Fri Nov 11 12:50:04 PST 2011
On 11/11/11 9:38 PM, Tobias Pankrath wrote:
> Awesome, thank you :) That should really make its way into phobos someday.
> However I wouldn't prefix everything with static, although it seems, that is
> the way phobos is going to do this. Instead I would use uppercase names for
> templates to distinguish them from normal functions.
I agree with you, prefixing stuff with Static… adds exactly no value.
The problem is that Phobos defines quite a few types of similar names
for the return type of the »dynamic« higher order functions (or rather
defined, Andrei has been migrating them to »opaque« auto retuns), which
could lead to confusion.
My plan was to drop any prefixes, simply calling the templates Map,
Filter, and so on, choosing the case depending on whether a
template/type/type-tuple or value is returned, and encourage users to
use renamed imports for clarity in cases where it's not obvious (i.e.
import meta = std.meta).
David
More information about the Digitalmars-d-learn
mailing list