A specific example:
In Symbol
Table for Monolithic Scope, class SymbolTable implements the
interface Scope. Is that equivalent to Scope being an abstract base
class of SymbolTable? Structurally it seems so because the only
public methods, aside from the constructor and toString, are from
Scope.
However, the “inherited” methods from Scope refer to the elements introduced by SymbolTable, but except for define, not the other way around. Functionally that seems to say that Scope has a SymbolTable, not SymbolTable is a Scope. Would it then be possible to turn the implementation around: make Scope the fundamental element, create a more simple SymbolTable class that only contains the HashMap (or equivalent), and move initTypeSystem and toString to Scope?
That seems to make more sense from a Python point of view. Am I missing something fundamental that invalidates this approach?
Aside: for those that never heard
of APL, it was widely considered a write-only language consisting
mostly of non-standard symbols. You either had to use a graphics
terminal that could generate them, or bought a special wheel for your
daisy-wheel printer. Chances were good you could not understand your
own code in a few days, and someone else's –not bloody likely at
all.