On Thu, Dec 12, 2002 at 10:35:47AM +1100, Damian Conway wrote:
> Dave Storrs wrote:
> > - the ability for the programmer to set "limiters" (??better name??)
> > on the junction, which will specify how the junction should
> > collapse--e.g. always collapse to the lowest/highest value that hasn't
> > been supplied yet, or to the lowest/highest unsupplied value that
> > causes a particular code block to return true, or whatever.
>
> Junctions don't "collapse". They distribute.
>
> Remember: Junctions Aren't Quantum.
Ah. Obviously, I don't know JAQ. (sorry)
However, I don't believe this answers my question...or, more likely, I
am just misunderstanding junctions. I believe that this code:
my $i = one(7...);
print $i;
Is roughly equivalent to this English:
- declare a lexical variable $i
- create a junction. The states of the junction are (7..Inf). The
type of the junction is "one"
- assign the junction to $i
- distribute the junction [that still doesn't sound right, but ok] by
choosing one of the states (at random??)
- print the number chosen in the previous step.
First of all, am I correct about this?
Second, what I was originally asking is this: could there be some way
for the programmer to attach a (method/code block/sub/whatever) to the
junction, such that when the state is chosen, the default method of
choosing a state is overriden by the code supplied by the programmer.
--Dks