in reply to (ichimunki) Re x 3: Thoughts on Perl6 - Love it? Hate it?
in thread Thoughts on Perl6 - Love it? Hate it?
The point is to encapsulate the strategy of determining which direction to go. That's what a switch statement does. This is, basically, a Switch object. (An example of a Strategy pattern, for those following along at home.)sub Switcheroo { my @conditions = @_; if ($conditions[0] < 10) { return 'FOO'; } else { return 'BAR'; } }
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
---|
Replies are listed 'Best First'. | |
---|---|
(ichimunki) Re x 5: Thoughts on Perl6 - Love it? Hate it?
by ichimunki (Priest) on Jan 11, 2002 at 03:43 UTC | |
by dragonchild (Archbishop) on Jan 11, 2002 at 20:28 UTC |