> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> Date: Wed, 11 Dec 2002 17:24:54 -0800
> From: Dave Storrs <[EMAIL PROTECTED]>
> Mail-Followup-To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> Content-Disposition: inline
> X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/
> 
> 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.

No collapsing.  Not without an explicit .pick.  It would call C<print>
with each of the values of $i  (unless print was designed to accept a
junction, in which case you'd get some stringification/serialization
of the junction).  C<print> would return a one() junction of whatever
print returned after printing each value, but what do you care,
they're all in the garbage anyway? :)

> First of all, am I correct about this? 

No. As I just explained.

> 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.

Your question is now irrelevant.

Luke

Reply via email to