On Fri, 18 Feb 2005 23:12:40 +0100, Eirik Berg Hanssen
<[EMAIL PROTECTED]> wrote:
> Ashley Winters <[EMAIL PROTECTED]> writes:
> 
> > On Fri, 18 Feb 2005 12:47:51 -0700, Luke Palmer <[EMAIL PROTECTED]> wrote:
> >> Run through your mind how this would be done with a junction in $x.
> >> Particularly focus on:
> >>
> >>     2..sqrt($x)
> >>
> >> What the hell does that mean?  Do you get a junction of lists out?  Or
> >> does sqrt die because it's not expecting a junction?
> >
> > sqrt() won't die; it gets threaded and returns a Junction, I would
> > expect. It's the lack of an &*infix:<..>(Int, Junction) function which
> > causes death
> 
>   Why does that cause death instead of authothreading?

Okay, I changed my mind. I think it does it does work for ~~ matching,
but not as an iterator

given 2 {
    when 1 .. sqrt(3|6) { ... }    # would work
}

for(1 .. sqrt(3|6)) { ... }   # would fail, since Junction doesn't "do
Iterator" or whatever

1 .. sqrt(10) -> LazyList of (1..3)
1 .. sqrt(10|20) -> Junction of any(1,2,3, 1,2,3,4)

LazyList does Iterator, but Junction does not. You'd have to use (1 ..
sqrt(3|6)).values to iterate through the possible values
semi-randomly.

More likely, I'm nuts.

Ashley

Reply via email to