in reply to Junction question
I can't find any documentation that suggests a trace is left of which element in a disjunction has short-circuited (succeeded). Have a look at the source for Perl6::Junction::Any; it's fairly instructive.
Update:
For example:
if $dave == any(1,4,9) { print "I'm sorry, Dave, you're just a square." }pretty good and concise! But how can I know $dave is equal to which element?
As I said, you probably can't. That's not what it's for.
I guess you're thinking about the disjunction in terms of a captured set of regexp alternatives where you can figure out which alternative matched while accepting any of the alternatives... Junctions don't really work that way; as I suggested, have a look at the Perl6::Junction::Any code.
Also, to understand the concept more generally, take a look at Quantum::Superpositions.
-David
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Juction question
by Anonymous Monk on Oct 31, 2007 at 11:21 UTC |