develooper Front page | perl.perl6.language | Postings from November 2002

Re: String concatentation operator

Thread Previous | Thread Next
From:
Damian Conway
Date:
November 18, 2002 14:05
Subject:
Re: String concatentation operator
Message ID:
3DD9642E.6020100@conway.org
matt diephouse wrote:


>>     $junction = $x | $y | $z;
>>     foo($junction);            # Call foo($x), foo($y), and foo($z)
>>                                # in parallel and collect the results
>>                                    # in a disjunction
> 
> 
> Looking at that code, I'm wondering how you pass a junction. Suppose I 
> want to pass a junction to a subroutine instead of calling the sub with 
> each value of the junction... how would I do that?

Tell the sub that it's expecting an undistributed junction as its argument:

	sub foo($param is junction) {...}

Damian


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