in reply to Useless unless
That said, I would not advocate for removing this feature from the language itself. I feel removing a feature should be done if pretty much (subjective huh?) everyone in the user community do not use it (or) the feature has a significant overhead to the parser and has little benefit or other reasons that my mind cannot grasp.
I am aware of unless traps. But I cannot blame the lang if i fall for it. I always have the choice to pick if.
Regarding the otherwise suggestion i like it, if it is not going to span multiple lines. What i miss the most is something like this -
doX() if ($cond) otherwise doY();
I know i could do
if ($cond) { doX(); } else { doY(); }
(or)
($cond) ? doX() : doY();
The last one is pretty much the same as otherwise but just that otherwise gives a natural lang feel
-SK
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Useless unless
by BrowserUk (Patriarch) on Aug 07, 2005 at 07:16 UTC | |
by tilly (Archbishop) on Aug 08, 2005 at 05:00 UTC | |
by sk (Curate) on Aug 08, 2005 at 06:07 UTC | |
by tilly (Archbishop) on Aug 08, 2005 at 15:06 UTC | |
by sk (Curate) on Aug 08, 2005 at 16:46 UTC | |
by BrowserUk (Patriarch) on Aug 08, 2005 at 06:34 UTC |