Bailey 10.1.1: Example: Simulating Recursion
Bailey B.6 on Inheritance and Subtyping
Faster ways to implement count updating:
Consider just returning the <String,Integer> pair, either Map.Entry<String,Integer> or StrIntPair. The former is more standard, though a little obscure.
You don't want to return anything that includes details about the storage implementation. This would include a Treenode, as the user could then change the left and right subtrees.
If you return a pair, then the user gets no internal access. But the user is also now able to modify the count. Furthermore, a "return_or_create()" method is a little more universal than an "install_or_increment_count()" method.
Generate stack code for expressions: expr_stackmachine.java
Iterators? Bailey Chapter 8