STRATEGY PATTERN? "Ben Tilly" <ben_tilly / hotmail.com> wrote in <LAW2-F64R6IHupeyyfI0000484b / hotmail.com>: <<SNIP>> > class RecDescent > > # Try these rules in order > class Alt <<SNIP>> > > def parse (str, pos=0) <<SNIP>> > end > end > > # Match all rules in turn > class InOrder <<SNIP>> > > def parse (str, pos=0) <<SNIP>> > end > end > > > # And so on, more classes for each type of rule > > end > Why not have a base (strategy) class, say RecDescentParseStrategy, on the "same level" as RecDescent and let Alt and InOrder (and ...) be subclasses of RecDescentParseStartegy? At least the attr_accessor and the initialize method could be inherited. Clemens