> 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? 

They're not necessary. The same example could be:

   switch ([want]) {
        case 'LIST'     { @ret = &wrapped }
        case 'SCALAR'   { $ret = &wrapped }
        &wrapped
   }
   
   > 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! ;-)
  
   > And do switches have elses? (meaning none of the cases were satisfied)

Yes. See the example above :-)

Damian

Reply via email to