Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Re: Apocalypse 4 on

by adamsj (Hermit)
on Jan 19, 2002 at 07:10 UTC ( #140037=note: print w/replies, xml ) Need Help??

in reply to Re: Apocalypse 4 on
in thread Apocalypse 4 on

I know what you mean, but given (sigh) how often this'll be used, I think it's better to Huffman it. If anyone has a brilliant idea for a shorter keyword than default, I hope they'll send it in.


They laughed at Joan of Arc, but she went right ahead and built it. --Gracie Allen

Replies are listed 'Best First'.
Re (tilly) 3: Apocalypse 4 on
by tilly (Archbishop) on Jan 22, 2002 at 04:58 UTC
    How about nothing?
    given ($foo) { when (1) {print "One";}; when (2) {print "Two";}; print "Didn't fit any case we know about"; }
    Indent to taste.

    I don't think that "normal code" will often see a difference. While I can dream up situations where I think it matters, in all of them you are doing evil, awful things that you probably shouldn't. (Like using a default to shortcircuit out of a function.)

      That is already defined to work but doesn't solve the problem of the presense of a real "default" block changing the handling of exceptions.

              - tye (but my friends call me "Tye")
Re: Re: Re: Apocalypse 4 on
by Juerd (Abbot) on Jan 20, 2002 at 21:57 UTC
    If anyone has a brilliant idea for a shorter keyword than default, I hope they'll send it in.
    Not shorter, but I think it's easier to read and a lot better:
    given $foo { when 1 { ... } when 2 { ... } when we have tried all other options and really have nothing left but this last resort { ... } }


    2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$

Re: Re: Re: Apocalypse 4 on
by scott (Chaplain) on Jan 20, 2002 at 21:15 UTC

    I pondered that for a bit but the best I could to was orelse. But that's even worse. :(.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://140037]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2016-10-23 13:12 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (301 votes). Check out past polls.