On Thursday, March 13, 2003, at 01:23 PM, Dave Whipp wrote:
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;

Ah, I get it. But why would you want that -- treating Foo and Baz as synonymous? Shouldn't you always be using Baz instead of Foo, if you really mean Baz and not Foo, and vice versa? Because later on, if you changed it such that:


   class Foo is Bar;
   typedef Baz is Bar is blarpy;

Foo.isa("Baz") == FALSE; # BOOM!

...which would break anything that relied on the symmetry.

Mind you, I'm not really against the idea, I'm just devil's advocating -- trying to think whether we really need the feature or whether we just _think_ we need it because we're all used to it from C, when in fact P6 will provide better ways of doing it. (?)

MikeL



Reply via email to