You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function test( name ) {
switch( name ) {
case /^steve$/i {
printf("I'm a regexp\n");
}
case "Steven" {
printf("I know you!\n" );
}
default {
printf("I don't know who you are\n" );
}
}
}
test( "Steve" ); // Regexp match
test( "Steven" ); // Literal match
test( "Bob" ); // Unhandled case
NOTE: I explicitly use blocks here, because fall-throughs are evil :)
The text was updated successfully, but these errors were encountered:
I want to allow this to succeed:
NOTE: I explicitly use blocks here, because fall-throughs are evil :)
The text was updated successfully, but these errors were encountered: