Assuming I have things that have more than one condition, lets say colors = (Red blue green) and sizes (small medium and large) and luster (shiny dull). Now
unless ( size eq small and color eq red and luster eq dull ) { do_something} elsunless ( luster eq dull ) { do_something else} else {do_a_totally_different_thing)
So the unless does everything but small red dull things. the elsunless does whatever is left but dull things. So there would still be small dull red things for the else to deal with (I hope my logic is sound, as I mentioned above confusing). So from my understanding of my sequence of events it would be easier to just say:
if ( luster eq dull and color eq red and size eq small ) {do_a_totally_different_thing) elsif ( luster eq shiny ) { do_something_else } else { do_something }
I hope that my logic is not so flawed, as to have my point missed among my errors. And I would be happy to revise this if it is messed up.
Anyhow, now that I have thoroughly confused myself I will, shutup.
-enlil
In reply to Re: if/unless and chaining
by Enlil
in thread if/unless and chaining
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |