> >is  => typing, inheritance, etc.
> >has => composition, aggregation, etc.
> 
> True, but those are basic OO concepts, which don't neatly apply to 
> property-lists (a very old Lisp concept that Perl6 is adopting).

"is" does seem to imply an OO is-a relationship. So lets run
with it!

If $foo is an object of type INTEGER, then $foo.bit calls a
method that compares the numeric value against 0 and returns
1 if not zero.

If $foo is true, then its method $foo.bit is expected to return
1.

In OO terms, when you override the behaviour of your methods, you
are usually subclassing. So perhaps the declaration "$foo is true"
should literally mean: "create an anonymous subclass derived from
$foo's class that overrides its .bit method to return 1; change
$foo's class to this new subclass" Multiple "is" declarations
would simply stack up the subclasses.

If "true" is a class with a single method "sub .bit { return 1 }",
then the subclass of $foo is creating by copying "true"'s methods.
So "$foo is myClass" simply means that we subclass $foo with a
clone of myClass. "constant" would be a class that overrides the
assignment operator.

On a slightly different note, I read that "my Dog $foo" doesn't
call a ctor. I do hope that "my URL $name; ...; $name="www.foo.bar"
does DWIM.


Dave.

p.s. I prefer to paint my bikeshed's true and false as .bool, not
.bit. In the hardware world, the distinction is important because
we often slip into negative logic.

--
Dave Whipp, Senior Verification Engineer,
Fast-Chip inc., 950 Kifer Rd, Sunnyvale, CA. 94086
tel: 408 523 8071; http://www.fast-chip.com
Opinions my own; statements of fact may be in error. 

Reply via email to