On Mon, Aug 07, 2000 at 05:18:07PM +1000, Damian Conway wrote:
>    > 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.
> 
> You've just convinced me to take else's out of the proposal! ;-)

Glad to be of service!  (But I was hoping you'd get rid of case too ;-)

        switch ([want]) {
            'LIST'      { @ret = &wrapped }
            'SCALAR'    { $ret = &wrapped }
            &wrapped
        }

        switch ($num) {
            0            { return 'zero' }
            [2,4,6,8]    { return 'even' }
            [1,3,4,7,9]  { return 'odd' }
            /[A-F]/i     { return 'hex' }
        }

etc.

-Scott
-- 
Jonathan Scott Duff
[EMAIL PROTECTED]

Reply via email to