How many more times is this going to happen before I finally realize what I'm doing?
O_o
I've thrown more braces at more Python than I am willing to admit.
I still like the idea, I just haven't worked everything out lol.
o_O
You can implement a `forEachMatch` mechanic as performing combinations using a handful of proxy classes.
Code:
match(isObjectLayer).match(isGravity).forEach([] (const Shared_Object& obj)->bool {
obj->addForce(getGravity(obj));
});
You only need to package a more advanced form of the filtering iterators we've already discussed such that the `<???>::match` of the proxy implements the desired combination.
Code:
template
<
// ...
>
class SIteratorFilter
{
// ...
};
Code:
template
<
// ...
>
class SMatch
{
// ...
SIteratorFilter</* ... */> begin()
{
return(SIteratorFilter</* ... */>(*this, PredicateAnder</* ... */>, *this));
}
SIteratorFilter</* ... */> end();
// ...
SMatch</* ... */> match(/* NewPredicate, ... */)
{
std::vector</* Predicate */> s(m);
return(SMatch</* ... */>(s.push_back(NewPredicate)));
}
// ...
std::vector</* Predicate */> m;
// ...
};
Code:
template
<
// FIterator
// FPredicateCollection
>
bool PredicateAnder(/* ... */)
{
// reverse depending on usage
// for c in anFPredicateCollection if c(anFIterator) return true
return(false);
}
The point I'm trying to get at is that knowing different languages actually seems to influence how I want to do things, rather than just what I'm doing, if that makes sense.
The source of the influence is more the different ways you can express your ideas.
Maybe JSP would be a good choice?
O_O
How did Yarin not comment on the JSP part?
Soma