At 11:58 PM +1300 3/4/03, Sam Vilain wrote:
Dan,
Sorry if I'm flogging a dead horse, but I just caught this call via the summarizer.
Okay, here's another shot at the semantics for objects [for perl 6]. If folks, especially non-perl folks, would look this over and chime in, I'd much appreciate it. Objects have (all optional): *) Properties *) Methods *) Attributes
Add to that: *) A superclass (obviously, but I consider it to be the same level as Properties, Methods and Attributes.) *) Associations, eg in UML. *) a set of Interfaces (similar to multiple inheritance; a way of grouping methods associated with a class for another to implement). eg, in Java and IDL.
Well... no. Besides this really being something for discussion on perl6-internals (so if everyone'd move this over there, please, and my followups will go there from now on) what you've bulleted are all properties of the class, not the object. I was only dealing with what the object presents to user code, not in how the classes behave.
Taking these in turn, though:
*) Property on classes, not objects, but yes we'll have superclasses.
*) We're not talking perl 5 style objects, rather objects as fundamental things with attributes. Associations, from what I can see from your description, don't really apply.
*) We'll be having a "does" as well as "is" (inheritance) and "has" (delegation) lists for classes, so interfaces will be queryable if the language building the class supports them.
Are you going to implement the concept of `scope' of methods/attributes? Many other languages have it, and I think in some circumstances it can help clarify the intent of code. Of course anally requiring it to be specified ends up with a language like Java :-).
Yeah, with nested namespaces for searching. It'll kill method caches in some cases, I think, without some fancy internal footwork, so the performance will probably blow chunks to start.
My humble opinion is that `public' attributes should just be implemented in terms of automatically generated accessor functions.
That's not parrot's call--we don't care. If a language wants to expose, it should explicitly (to parrot) expose. Whether the user sees it, or how the user sees it, is syntax, and I don't do syntax. :)
--
Dan
--------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk