develooper Front page | perl.perl6.language | Postings from July 2006

Re: Run time dispatch on ~~

Thread Previous | Thread Next
From:
Larry Wall
Date:
July 14, 2006 12:10
Subject:
Re: Run time dispatch on ~~
Message ID:
20060714190945.GA17219@wall.org
On Fri, Jul 14, 2006 at 04:34:26PM +0200, Dr.Ruud wrote:
: Aaron Sherman schreef:
: 
: >  given $_ {
: >    when $x {...}
: >  }
: >
: > or
: >
: >  $_ ~~ $x
: 
: Can that be written as ".~~ $x"?

No, but you might just possibly get away with writing:

    .infix:<~~>($x)

assuming that the $_.foo($x) SMD eventually fails over to foo($_,$x) MMD.
But that doesn't seem to be much of an improvement over "when $x".

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