judofyr/temple — Issue #51: Clarify class inheritances right
Author: hannesg
Created: 2011-12-02 18:46:37+00:00
State: open

Hi,
currently some class inhertances are unsuitable:

* Generator::StringBuffer is a subclass of Generator::Array. However Generator::Array returns an array of strings while Generator::StringBuffer returns a string, so Generator::String is not a proper subtype of Generator::Array.
* Same applies to MutableHash/ImmutableHash. The prefix immutable imho states that a hash is not mutable, however an instance of MutableHash is mutable and a kind of ImmutableHash.

If these classes should share code, they should inherit a common parent class or mixin.
Changing this may break compatibility with code using ImmutableHash, but the generators should still work.