switch/case (was Re: Want, wrapper subs and context preservation)
[email protected] (Jonathan Scott Duff) Mon, 7 Aug 2000 02:06:13 -0500
| Newsgroups | perl.perl6.language.subs |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Aug 07, 2000 at 05:49:37AM +1000, Damian Conway wrote:
> switch ([want]) {
> case 'LIST' { @ret = &wrapped }
> case 'SCALAR' { $ret = &wrapped }
> else { &wrapped }
> }
cases have elses? If so, why use a new word rather than hijacking
"if" to do the right thing inside of a switch block? Perl is already
super context-sensitive anyway.
And do switches have elses? (meaning none of the cases were satisfied)
-Scott
--
Jonathan Scott Duff
[email protected]