On Tue, 2004-04-20 at 15:40, John Siracusa wrote:
> On 4/20/04 2:37 PM, Larry Wall wrote:
> > It's wrong to introduce a fundamental asymmetry that breaks the contract that
> > an accessor can be used as a variable.
> 
> Er, I think we have different definitions of "accessor."  I'm perfectly
> happy to never allow anyone to do $obj.foo = whatever.  I just don't want to
> write trivial methods that get and set an attribute behind the scenes.

Eh? Why would you never allow anyone to use a simple syntax?

        $oldfoo = $obj.foo;
        $obj.foo = 1;

What's the problem here? No having to write trivial methods, no
complexity.

What Larry's trying to get at is that:

        $status = $thread_shared_data.status(lock=>1);

could be defined as a multi which gets the value of the status variable,
but also asserts that thread synchronization or some form of threadsafe
locking must be performed. You're not SETTING status, you're reading it,
but you are passing parameters to the read accessor. How do you do that
if parameters force a write?

-- 
Aaron Sherman <[EMAIL PROTECTED]>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback


Reply via email to