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

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
June 8, 2005 02:41
Re: reduce metaoperator on an empty list
Message ID:
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.

Hmm, the MMD form identity( &op, $value ) looks even better. This
folds the identity value selection problem back into type-space
and it's runtime agent MMD.
TSa (Thomas SandlaƟ)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About