develooper Front page | perl.perl6.language | Postings from June 2005

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
From:
Larry Wall
Date:
June 8, 2005 11:02
Subject:
Re: reduce metaoperator on an empty list
Message ID:
20050608180203.GB27179@wall.org
On Wed, Jun 08, 2005 at 11:40:49AM +0200, "TSa (Thomas SandlaƟ)" wrote:
: Damian Conway wrote:
: >So, to clarify again, if $var is undefined, then the assignment:
: >
: >    $var op= $value;
: >
: >is equivalent to:
: >
: >    $var = (&op.does(identval) ?? &op.identval() :: undef) op $value;
: >
: >Correct?
: 
: Might I add that it should read
: 
:       $var = (&op.does(identval) ??
:               &op.identval($value) :: undef) op $value;
: 
: The rational is, that &op is subject to MMD, so the .identval method
: should be dispatched as well. Actually &op.identity($value) reads
: quite natural and self documenting if the parameter is required.

I don't think there's a double dispatch there.  I think &op just knows
it can default its left argument to an existing attribute value if it
(somehow) knows it's part of an assignment op.  There's not a lot of
payback in getting all abstract here, as far as I can see.

Larry

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About