> > It's also far slower. Constructing a 31-element list, junctionizing 
> > it,
> 
> This might well be done at compile-time. And/or, lazily. So 
> the cost of these two steps is likely to be negligible.
> 
> > then testing against each element vs. 2 numeric comparisons.
> 
> Yes. That's a significant cost in this case.

My example was bad. I intended something with more behind it.

 print "creditcard" if $var == CreditCard( 'VISA' );

wich should do a mod10 on $var and then match a regex or something.

I think one could say "CreditCard( 'VISA' )" is then the property. And
after
reading further seeing it could be smart matched like:

 print "creditcard" if $var ~~ CreditCard( 'VISA' );

Brought to a point: Properties could be also smart matched.

Murat


Reply via email to