diff options
Diffstat (limited to 'src/tuplr.hpp')
-rw-r--r-- | src/tuplr.hpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tuplr.hpp b/src/tuplr.hpp index 059a6cf..0385533 100644 --- a/src/tuplr.hpp +++ b/src/tuplr.hpp @@ -93,6 +93,19 @@ struct Env : public list< vector< pair<K,V> > > { } }; +template<typename K, typename V> +ostream& operator<<(ostream& out, const Env<K,V>& env) { + out << "(Env" << endl; + for (typename Env<K,V>::const_reverse_iterator f = env.rbegin(); f != env.rend(); ++f) { + out << " (" << endl; + for (typename Env<K,V>::Frame::const_iterator b = f->begin(); b != f->end(); ++b) + cout << " " << b->first << " " << b->second << endl; + out << " )" << endl; + } + out << ")" << endl; + return out; +} + /*************************************************************************** * Lexer: Text (istream) -> S-Expressions (SExp) * |