Michael Lazzaro wrote:

Defining a Class for this is also overkill.
Ye.. well, no. Why?

class Foo is Bar; # normal inheritance class Baz is Bar; # the thing that we are over-killing

Foo.isa("Baz") == FALSE;

A lightweight, typedef-like mechanism behaves differently:

  class Foo is Bar;
  typedef Baz is Bar;

Foo.isa("Baz") == TRUE;

The problem biols down to the fact that inheritance hierarchies are, um, hierarchies -- trees. The lightwieght mechanism provides aliases for nodes within the tree, thus all descendent nodes are also descendents of the aliases.


Dave. -- http://dave.whipp.name



Reply via email to