Timothy S. Nelson writes:
 >      Hi all.  I hope this hasn't been discussed before.  I Googled for 
 > "perl6 meta-operators" and found nothing; likewise practically 
 > nothing searching the perl6-language archive for meta-operators.  
 > 
 > Question: are there any plans to have user-defined meta-operators in perl6?  
 > 
 > Explanation: By meta-operators, I mean operators which operate on other 
 >      operators (much as APL operators do to APL functions).  I'm thinking 
 >      it'd be widely useful in the core; it'd do a lot of the digraphs (like 
 >      += and those), and I can think of uses for it outside the core too.  
 > 
 >      Anyway, do we get them?  


there was some discussion in the thread under 
<http://archive.develooper.com/perl6-language%40perl.org/msg12119.html>
but there was no "last word" about it. either this is something perl
*trivially* will have due to its powerful grammar capabilities or it
is something perl will *avoid* to dwell in , or ... 

but it is interesting if perl will ( or already is ) be able to do
something like 

sub operator:tensor:[<op>] ( Code &op  is parsed( ... ) , 
                         Array|Hash|Scalar @a , 
                         Array|Hash|Scalar @b )
{ ... return array/hash/whatever  of  @a[i] op @b[k] for  all pairs (i,k) }   
                           
if that or something like that is possible , we will not need vector
operators "built in" the language  -- they will be just one of the 

sub operator:v:[<op>] ( Code &op  is parsed( ... ) , 
                         Array|Hash|Scalar @a , 
                         Array|Hash|Scalar @b )
{ ... return array/hash/whatever  of  @a[i] op @b[i] for  
      all i present in both arrays ( if intersection ) or 
      all i present in one or another  array ( if union )  
}

but I dont know . Just wishes from someone who dont see the whole
picture .

arcadi .

Reply via email to