Submission: switch (...) instanceof feature (original) (raw)

Artur Biesiadowski abies at adres.pl
Sun Mar 29 12:38:52 PDT 2009


  1. Why case void: instead of case null: ?

  2. What is a expected behavior in case of multiple matches ? For example

switch(collection) instanceof {

case RandomAccess: ...

case List: ...

case Collection: ...

}

Do I need to put switch cases in correct order because of top-to-down evaluation or most specific one will be used? Or maybe all matching ones ?

  1. I think you have forgotten to put 'break' in your examples, unless you plan to disallow fall-through.

Regards, Artur Biesiadowski



More information about the coin-dev mailing list