in reply to Expand Ranges in Lists of Numbers
is bad style because the ternery operator is being used in void context. You would be better using an if-else statement, because it is more readable. If you prefer the brevity of the ternery operator, then please use it as an assignment operator:$tmp[0] > $tmp[1] ? push @expanded, reverse ($tmp[1]..$tmp[0]) : push @expanded, ($tmp[0]..$tmp[1]);
I like the changes, by the way. Now we have a fully flogged dead horse. :Dpush @expanded, $tmp[0] > $tmp[1] ? reverse ($tmp[1]..$tmp[0]) : ($tmp[0]..$tmp[1]) ;
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Expand Ranges in Lists of Numbers (ternary in void context?)
by Aristotle (Chancellor) on Jun 09, 2003 at 12:16 UTC | |
|
Re: (jeffa) Re: Expand Ranges in Lists of Numbers
by The Mad Hatter (Priest) on Jun 09, 2003 at 01:45 UTC | |
by jeffa (Bishop) on Jun 09, 2003 at 02:28 UTC | |
by The Mad Hatter (Priest) on Jun 09, 2003 at 02:37 UTC | |
by jeffa (Bishop) on Jun 09, 2003 at 04:00 UTC | |
by The Mad Hatter (Priest) on Jun 09, 2003 at 12:16 UTC |