See: Title.
It would make some of our if -> else if -> blah trees a bit nicer.
ID:2026629
Jan 29 2016, 10:50 am
|
|||||||
Not Feasible
| |||||||
Jan 29 2016, 11:30 am
|
|
Lummox JR resolved issue (Not Feasible)
|
The switch() statement isn't meant to be used for types; at least not for general istype() checks where it could match every subtype too. switch() only works with specific values, or for numbers it allows ranges, but that's it.
But if you're doing something where you're just trying to collapse a bunch of if/else trees with istype() checks, then it seems like what you really want is polymorphism anyway. |
in our case, we use if/else if trees of istype() checks, where speed matters (proc call overhead), or because src type matters too, (like item interaction)
|