On Thu, Feb 17, 2005 at 02:18:55AM -0600, Rod Adams wrote: : The simple if is: : : if $x ~~ (1,2,3,4) {...} # parens needed here since , is lower than ~~ : in precedence.
That is asking if $x is a list containing 1,2,3,4. : Same for unless/while/until. And all of this from the entirely useful C< : ~~ >. The S04 code describing @Array ~~ $Scalar (for Num/Str) uses : junctions, but I'd argue a better implementation would be a short : circuiting C< for > loop, even if junctions exist. It's just plain : faster that way. Junctions can short circuit when they feel like it, and might in some cases do a better job of picking the evaluation order than a human. : So what I see now for utility of junctions is thus: : : - Common cases which C< ~~ > appears to handle for us suitably well. Only if we make lists second-class citizens. The need for junctions first became evident when we found ourselves filling the ~~ tables with various sorts of weird non-symmetries. : - Edge cases which, IMHO, do not merit the huffman level of several : single character operators. All of which can be accomplished without the : use of junctions, though not as gracefully. Grace is important. Even more important is mapping naturally to human linguistic structures, to the extent that it can be done unambiguously. : I see no need for junctions in core. I do, and I'm not likely to change my mind on this one. Sorry. Larry