> None of these perform more than one operation per pair of types.  By doing the
   > factoring, you are constraining the type and specific value of the left hand
   > expression in your matching operation, limiting the set of operations that can
   > be performed quite severely.
   >
   >    [snip]
   >
   > In this proposal, it would be the commonality of the parameter, not the
   > commonality of the test.  The test includes parameters and matching operation.
   > The type of the second parameter must be determined before the matching
   > operation can be determined.

No. Because the switch value can be a curried function too, so you can factor the
operation as well:

        switch ( $x < __ ) {

                case 0          { print "negative" }
                case 1          { print "unity" }
                case any(2..9)  { print "small" }
                case @list      { print "in range" }
        }


   >   if ( $v == @foo )
   > 
   > is clearly testing the size of foo against the value of $v.

That's not "clear" at all. It's a learned idiom that *isn't* obvious without
understanding. One might just as readily assume that comparison against
an array disjunctively distributes the comparison across the elements.
Of course, that way lies superpositions!

Sigh. We clearly differ irreconcilably on this issue. I suggest that you
counter-propose your version of case and we move on. Larry may well not like
either! ;-)

Damian

Reply via email to