On Sat, Sep 06, 2008 at 11:38:42AM -0500, John M. Dlugosz wrote:
> The when statements are just like if statements.  After executing one,  
> it goes on to the following statement which does not have to be a  
> conditional statement.  That is, you can mix when statements with plain  
> unconditional statements.
>
> If multiple when conditions match, it runs all of them.  It's more like  
> if statements, not like a C switch statement. 

No, when statements also imply a break at the end of the block.  It
should never run more than one (unless you explicitly say "continue").
You can mix unconditional statements, but any after the first matching
when will not be run (unless you say "continue").

If both "when *" and "default" are running, it's a small bug,
indicating that the "when * {...}" got turned into a mere "{...}"
or "..." on the assumption that you don't actually have to test for
the default condition.  Which you don't, but it should still run
only one default block, so it should really turn into something like
"{...; break}".

Larry

Reply via email to