how can I create a list of classes in C3 to itterate over in a loop
- by Jean-Bernard Pellerin
example:
Suppose I have class animal
And classes cat and dog extending it
I want to do something along the lines of
foreach (animal a in {cat, dog})
if (a.isValid(parameters))
doStuff();
(couldn't get the code formatting to work)
my only alternative is a switch statement for each class, something I'd like to avoid
Thanks,
J-B