fix(util/list_fn): rename iter to for_each
This commit is contained in:
parent
c50bc13be0
commit
3381df0150
2 changed files with 5 additions and 5 deletions
|
@ -130,7 +130,7 @@ pair<expr, expr> orelse_rewriter_cell::operator()(environment const & env, conte
|
|||
}
|
||||
std::ostream & orelse_rewriter_cell::display(std::ostream & out) const {
|
||||
out << "Or_RW({";
|
||||
iter(m_rwlist, [&out](rewriter const & rw) {
|
||||
for_each(m_rwlist, [&out](rewriter const & rw) {
|
||||
out << rw << "; ";
|
||||
});
|
||||
out << "})";
|
||||
|
@ -160,7 +160,7 @@ pair<expr, expr> then_rewriter_cell::operator()(environment const & env, context
|
|||
}
|
||||
std::ostream & then_rewriter_cell::display(std::ostream & out) const {
|
||||
out << "Then_RW({";
|
||||
iter(m_rwlist, [&out](rewriter const & rw) {
|
||||
for_each(m_rwlist, [&out](rewriter const & rw) {
|
||||
out << rw << "; ";
|
||||
});
|
||||
out << "})";
|
||||
|
@ -189,7 +189,7 @@ pair<expr, expr> try_rewriter_cell::operator()(environment const & env, context
|
|||
}
|
||||
std::ostream & try_rewriter_cell::display(std::ostream & out) const {
|
||||
out << "Try_RW({";
|
||||
iter(m_rwlist, [&out](rewriter const & rw) {
|
||||
for_each(m_rwlist, [&out](rewriter const & rw) {
|
||||
out << rw << "; ";
|
||||
});
|
||||
out << "})";
|
||||
|
|
|
@ -119,12 +119,12 @@ list<T> map(list<T> const & l, F f) {
|
|||
\brief Given list <tt>(a_0, ..., a_k)</tt>, exec f(a_0); f(a_1); ... f(a_k)</tt>.
|
||||
*/
|
||||
template<typename T, typename F>
|
||||
void iter(list<T> const & l, F f) {
|
||||
void for_each(list<T> const & l, F f) {
|
||||
if (is_nil(l)) {
|
||||
return;
|
||||
} else {
|
||||
f(head(l));
|
||||
return iter(tail(l), f);
|
||||
return for_each(tail(l), f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue