At 9:49 AM +0100 3/3/03, Erik Bågfors wrote:
On Sun, 2003-03-02 at 23:21, Dan Sugalski wrote:
 Okay, here's another shot at the semantics for objects. 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

Can you give a clear example of what the difference is between properties and attributes?

Properties are runtime assigned name/value pairs that are stuck on a variable. They're not particularly restricted to objects, though many systems do that. (We aren't going to) A property isn't guaranteed to be on any particular object except perhaps by convention.

Attributes, on the other hand, correspond to instance variables or
slots in other object systems. They're generally guaranteed to be on
any object of a particular class or child of a particular class--if
class Foo defines an attribute bar, then all Foo objects will have a
slot for the bar attribute.

Attributes are often fixed at compile or object creation time, but
we're not going to do that as I don't think we can, much as I'd like
to.
--
                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to