Dan Sugalski wrote:

Hrm. What happens if the junction is then used as an iterator?

  $junction = File::Open("foo") | File::Open("bar);
  for (<$junction>) {
     ...
  }
In Larry's formulation that's just the same as:

	while $_ := $junction.next { ... }

which, when called on a junction, C<next>s each state in parallel and
returns a junction of the returned values. In other words, in each iteration
$_ will have a disjunction of the next lines from files foo and bar.

	
Which could get interesting if inside the for loop the code creates more junctions and iterates over them. (Potentially ad infinitum)
The C<for> loop is still single-threaded, only the values it's iterating
are multiplexed.


And here I thought Quantum INTERCAL was a joke... :)
Junctions Aren't Quantum.

Damian


Reply via email to