Re: Draft Proposal: Attributes: "public" vs. "private"

2002-10-13 Thread John Williams
On Sat, 12 Oct 2002, Larry Wall wrote: > On Sat, 5 Oct 2002, John Williams wrote: > : Personally, I hope they look like attributes. > > They will, outside the class anyway. Inside it's $.foo. > > : But if they do, the perl5 > : lvalue subs are not the way to do it. Why? Because an lvalue sub re

Re: Draft Proposal: Attributes: "public" vs. "private"

2002-10-13 Thread Larry Wall
On Sat, 5 Oct 2002, John Williams wrote: : I think everyone agrees that some sort of simple accessor syntax will be : included (instead of the getX/setX hack). But will accessors _look_ like : attributes or methods? : : # look like methods : object.foo($value); : : # look like attri

Re: Draft Proposal: Attributes: "public" vs. "private"

2002-10-07 Thread Chris Dutton
On Sunday, October 6, 2002, at 12:57 AM, Noah White wrote: >> >>> Note that an alternate definition of "private" is often used, as >>> follows: >>> >>> A "private" attribute is an attribute whose scope is restricted >>> such that >>> it may be accessed only within the class in which it

Re: Draft Proposal: Attributes: "public" vs. "private"

2002-10-06 Thread Dan Sugalski
At 4:29 PM -0600 10/5/02, John Williams wrote: >On Sat, 5 Oct 2002, Michael Lazzaro wrote: > >> Dan Sugalski wrote: >> > >> > There won't be any direct access to attributes outside class methods >> > of the class that defines the attributes, unless Larry changes his >> > mind in a big way. (A

Re: Draft Proposal: Attributes: "public" vs. "private"

2002-10-05 Thread Noah White
> >> Note that an alternate definition of "private" is often used, as >> follows: >> >> A "private" attribute is an attribute whose scope is restricted such >> that >> it may be accessed only within the class in which it has been >> declared, >> OR WITHIN ANY CLASS THAT INHERITS

Re: Draft Proposal: Attributes: "public" vs. "private"

2002-10-05 Thread Noah White
On Friday, October 4, 2002, at 07:39 PM, Michael Lazzaro wrote: [SNIP] > Definition: "private": > > A "private" attribute is an attribute whose scope is restricted such > that > it may be accessed only within the class in which it has been > declared. > It is not available

RE: Draft Proposal: Attributes: "public" vs. "private"

2002-10-05 Thread Brent Dax
John Williams: # Personally, I hope they look like attributes. But if they # do, the perl5 # lvalue subs are not the way to do it. Why? Because an # lvalue sub returns # a lvalue which get set _after_ the sub returns. At that # point it is too # late for the sub to do anything useful wit

Re: Draft Proposal: Attributes: "public" vs. "private"

2002-10-05 Thread John Williams
On Sat, 5 Oct 2002, Michael Lazzaro wrote: > Dan Sugalski wrote: > > > > There won't be any direct access to attributes outside class methods > > of the class that defines the attributes, unless Larry changes his > > mind in a big way. (And, honestly, probably not even then) Instead > > it'll al

Re: Draft Proposal: Attributes: "public" vs. "private"

2002-10-05 Thread Dan Sugalski
At 12:53 PM -0700 10/5/02, Michael Lazzaro wrote: >Dan Sugalski wrote: >> >> There won't be any direct access to attributes outside class methods >> of the class that defines the attributes, unless Larry changes his >> mind in a big way. (And, honestly, probably not even then) Instead >> it'll

Re: Draft Proposal: Attributes: "public" vs. "private"

2002-10-05 Thread Michael Lazzaro
Dan Sugalski wrote: > > There won't be any direct access to attributes outside class methods > of the class that defines the attributes, unless Larry changes his > mind in a big way. (And, honestly, probably not even then) Instead > it'll all be accessed via lvalue methods. If an attribute is exp

Re: Draft Proposal: Attributes: "public" vs. "private"

2002-10-04 Thread Dan Sugalski
At 4:39 PM -0700 10/4/02, Michael Lazzaro wrote: >Under the principle of TMTOWTDI, perl allows public attributes >within a class. However, you must explicitly declare an attribute >to be public. There won't be any direct access to attributes outside class methods of the class that defines the

Slots [was Re: Draft Proposal: Attributes: "public" vs. "private"]

2002-10-04 Thread schwern
This all looks good to me. I seem to have gone off on a tangent about slots, so I've mercifally changed the subject. On Fri, Oct 04, 2002 at 04:39:40PM -0700, Michael Lazzaro wrote: > [CONS] > > - Making publicly accessible attributes at all is considered Bad Form > in most OO methodologies (