in reply to (ichimunki) Re: Thoughts on Perl6 - Love it? Hate it?
in thread Thoughts on Perl6 - Love it? Hate it?
Switch? Not terribly big deal to me either way. I can see it's value if you want to do some sort of goto-based dispatch, and yes I consider it an improvement over a hash full of coderefs since the conditions in a switch can be more involved that the simple labels that are hash keys. Enough languages have this that there's no reason to avoid it.
I have to disagree with you here. What's wrong with the following?
my %SomeHashWithCoderefs = ( FOO => \&foo, BAR => \&bar, BAZ => \&baz, ); sub Switcheroo { my @conditions = @_; # Using the @conditions, return 'FOO', 'BAR', or 'BAZ' } # In some main area... $SomeHashWithCoderefs{Switcheroo(@args)}->(@otherargs);
------
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 3: Thoughts on Perl6 - Love it? Hate it?
by ichimunki (Priest) on Jan 10, 2002 at 23:17 UTC | |
by dragonchild (Archbishop) on Jan 10, 2002 at 23:30 UTC | |
by ichimunki (Priest) on Jan 11, 2002 at 03:43 UTC | |
by dragonchild (Archbishop) on Jan 11, 2002 at 20:28 UTC |
In Section
Meditations