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
I suppose you could write one which would pick a random value:
multi sub *infix:<..>(Int $x, Junction $y) {
return $x .. first { .does(Int) } $y.values;
}
Ashley Winters