Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Object notes

7 views
Skip to first unread message

Dan Sugalski

unread,
Feb 23, 2004, 11:28:41 AM2/23/04
to perl6-i...@perl.org
As I wait for an interim setup to build...

Here's the lowdown on what we're going to get with object:

1) Multiple Inheritance
2) Attributes
3) Object instantiation
4) Method calls

Woo. What we won't get is:

1) Adding parents to a class that's been subclassed or instantiated
2) Adding attributes to a class that's been subclassed or instantiated
3) Method redistpatch
4) Fancy namespace lookups

So you can create classes with multiple parents and multiple
attributes, instantiate objects, call methods on the objects, and
twiddle the objects attributes. If the parents of "Foo" are "Bar",
"Baz", and "Some::Other::Thing" then we'll search those in order,
treating the colons as, well, colons, rather than namespace
separators. That means no hierarchical namespaces. Yet.

Adding methods to a class means sticking a PMC for the named method
in the class namespace. So this:

ns = global "Some::Other::Thing"
ns['bar'] = SomeMethodPMC

is how to add the method 'bar' to the namespace "Some::Other::Thing".
This will change, and may well not have to be done if the namespace
stuff we were asking about earlier is actually in, but I'm not sure
yet. I expect I'll find out soon.
--
Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk

0 new messages