Re: Generalizing ?? !!

2007-06-11 Thread Luke Palmer
On 6/11/07, Jonathan Lang <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote: > Besides ?? !! with out an else part is just &&. No, it isn't. While && behaves properly when the condition turns out to be true, the result of the condition turning out to be false is whatever the condition turned o

Re: Generalizing ?? !!

2007-06-11 Thread Jonathan Lang
[EMAIL PROTECTED] wrote: Besides ?? !! with out an else part is just &&. No, it isn't. While && behaves properly when the condition turns out to be true, the result of the condition turning out to be false is whatever the condition turned out to be. Still, Damian has a good point - which rend

Re: Generalizing ?? !!

2007-06-11 Thread mark . a . biggar
Besides ?? !! with out an else part is just &&. -- Mark Biggar [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] -- Original message -- From: Damian Conway <[EMAIL PROTECTED]> > Mark J. Reed concluded: > > > So I prefer keeping a single construct, but perhaps

Re: Generalizing ?? !!

2007-06-11 Thread Damian Conway
Mark J. Reed concluded: So I prefer keeping a single construct, but perhaps the else-part could be optional? I hope not. The mandatory else-part is one of the most valuable features of the ternary operator. It helps ensure that variables initialized with a cascaded ternary actually do get in

Re: Generalizing ?? !!

2007-06-11 Thread Mark J. Reed
Ok, let me take a step back and see what's being suggested. it certainly seems like a case can be made for a binary operator, say ??, that returns its rhs if the lhs is true, undef otherwise, analogous to the shell's ${var+val} construct. At first glance it appears that the desired ternary behav

Re: Generalizing ?? !!

2007-06-11 Thread Jonathan Lang
Audrey Tang wrote: Jonathan Lang wrote: > A variation of chaining associativity gets > used, with the "chaining rule" being '$v1 op1 $v2 // $v1 op2 $v3' > instead of '$v1 op1 $v2 && $v2 op2 $v3', as is the case for comparison > chaining. But wouldn't that make: True ?? undef !! Moose; evalu

Re: Generalizing ?? !!

2007-06-11 Thread Larry Wall
On Mon, Jun 11, 2007 at 12:16:35PM +0200, Juerd Waalboer wrote: : Zev Benjamin skribis 2007-06-11 0:57 (-0400): : > ?? and !! could always return some kind of result object that boolizes : > to true or false. : : Can we *please* keep simple things simple? Indeed, basic control flow is not a good

Re: Generalizing ?? !!

2007-06-11 Thread Juerd Waalboer
Zev Benjamin skribis 2007-06-11 0:57 (-0400): > ?? and !! could always return some kind of result object that boolizes > to true or false. Can we *please* keep simple things simple? -- korajn salutojn, juerd waalboer: perl hacker <[EMAIL PROTECTED]> convolution:

Re: Generalizing ?? !!

2007-06-11 Thread Zev Benjamin
?? and !! could always return some kind of result object that boolizes to true or false. Zev Audrey Tang wrote: > > 在 Jun 11, 2007 5:10 AM 時,Jonathan Lang 寫到: >> A variation of chaining associativity gets >> used, with the "chaining rule" being '$v1 op1 $v2 // $v1 op2 $v3' >> instead of '$v1 op

Re: Generalizing ?? !!

2007-06-11 Thread NeonGraal
On Jun 11, 9:10 am, [EMAIL PROTECTED] (Jonathan Lang) wrote: > Rereading A03, I ran across the original reasoning behind why Perl 5's > '?:' trinary operator became '?? ::' first, and then '?? !!'. Three > reasons were given: > > * the '?' and ':' tokens are far too broadly useful to be gobbled up

Re: Generalizing ?? !!

2007-06-11 Thread Hakim Cassimally
On 11/06/07, Audrey Tang <[EMAIL PROTECTED]> wrote: 在 Jun 11, 2007 5:10 AM 時,Jonathan Lang 寫到: > A variation of chaining associativity gets > used, with the "chaining rule" being '$v1 op1 $v2 // $v1 op2 $v3' > instead of '$v1 op1 $v2 && $v2 op2 $v3', as is the case for comparison > chaining. Bu