Re: Thinking about Accessors

2004-02-29 Thread Aaron Sherman
On Fri, 2004-02-27 at 21:57, Luke Palmer wrote: method bar_attr() will get { $.bar_attr } will set { $.bar_attr = $_ } I'm confused by this in only one way... since method bar_attr and the accessor bar_attr have the same name, how do I write an accessor that recurses?

Re: Thinking about Accessors

2004-02-29 Thread Larry Wall
On Sun, Feb 29, 2004 at 01:44:47PM -0500, Aaron Sherman wrote: : On Fri, 2004-02-27 at 21:57, Luke Palmer wrote: : : method bar_attr() will get { $.bar_attr } :will set { $.bar_attr = $_ } : : I'm confused by this in only one way... since method bar_attr and the :

Re: Thinking about Accessors

2004-02-28 Thread Larry Wall
On Fri, Feb 27, 2004 at 09:27:20PM -0700, John Williams wrote: : On Fri, 27 Feb 2004, Luke Palmer wrote: : John Williams writes: : I want to get from here : :method bar_attr(?$val) is accessor { : $.bar_attr = $val if exists $val; : return $.bar_attr; :} : : I

Re: Thinking about Accessors

2004-02-27 Thread Luke Palmer
John Williams writes: I want to get from here method bar_attr(?$val) is accessor { $.bar_attr = $val if exists $val; return $.bar_attr; } to here method bar_attr() is rw { return my $x is Proxy ( for = $.bar_attr, FETCH = {