Buddha Buck writes:
: It's weirder when you allow multiple guard conditions to be true with no
: guarantee of evaluation order. But I see no reason to disallow it.
Well, Perl would guarantee the order. I can see situations where it'd
be better to force a random pick to avoid starvation proble
Piers Cawley writes:
: Also known as constructs you wish you hadn't discovered.
:
: So, I'm reading through Finkel and I came across the following, which
: computes the greatest common divisor of a and b (recast into perl6ish
: syntax)
:
: while {
: when $a < $b { $b -= $a }
: when $b
At 05:51 PM 04-16-2002 +0100, Piers Cawley wrote:
>Also known as constructs you wish you hadn't discovered.
>
>So, I'm reading through Finkel and I came across the following, which
>computes the greatest common divisor of a and b (recast into perl6ish
>syntax)
>
> while {
> when $a < $b { $b
Also known as constructs you wish you hadn't discovered.
So, I'm reading through Finkel and I came across the following, which
computes the greatest common divisor of a and b (recast into perl6ish
syntax)
while {
when $a < $b { $b -= $a }
when $b < $a { $a -= $b }
}
The idea is that