in reply to if/unless and chaining
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: if/unless and chaining
by jryan (Vicar) on Nov 06, 2002 at 07:53 UTC | |
|
Re: Re: if/unless and chaining
by John M. Dlugosz (Monsignor) on Nov 06, 2002 at 04:36 UTC | |
by Enlil (Parson) on Nov 06, 2002 at 05:34 UTC |