At 5:30 PM +0100 3/3/03, Erik Bågfors wrote:
On Mon, 2003-03-03 at 16:52, Garrett Goebel wrote:
 From: Erik Bågfors [mailto:[EMAIL PROTECTED]
 >
 > 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?

My imperfect understanding is:

 "attribute" is only used in an OO context and refers to the data members the
 class or object encapsulates.

 "property" has nothing inherently to do with OO. Properties are tags against
 variables and values and are compile or run time specific. Hints to the
 compiler and interpreter...

Ok, any example of such a property....?

readonly, for example. Or color, though that's more a constant property. Truth is another one--whether an object is true or false may be independent of its value, in which case there'd be a boolean property on it. (And if there wasn't a boolean property the truthness would be figured out based on the value)

Python's attributes map to parrot properties if I understand them
right, as they're global to an object and created dynamically at
runtime, rather than mapping to parrot's attributes, but that's OK.
Plenty of object model constructs to go around.

--
                                        Dan

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

Reply via email to