At 9:05 AM +1100 11/19/02, Damian Conway wrote:
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:
Hrm. What happens if the junction is then used as an iterator?

$junction = File::Open("foo") | File::Open("bar);
for (<$junction>) {
...
}

Which could get interesting if inside the for loop the code creates more junctions and iterates over them. (Potentially ad infinitum)

And here I thought Quantum INTERCAL was a joke... :)
--
Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk

Reply via email to