[STD, S03] slaughter of the LTM metatokens

This cleans up the metaop scene quite a bit.  Bravo!

I went through STD.pm with a fine tooth comb again, to extract what I'd say about which operators were allowed to be meta'd by each given metaop:

(The notation "foo --> bar" means, takes an operator of type foo and makes an operator of type bar)

op=     infix --> infix
    op can't be :assoc<non>
    op must be :assign

** The first test is excessive: There are no non-associative operators that have the :assign property. Hence, testing for :assign should be enough. Besides, I'm not sure what about this metaop should require non-associativity from its internal operator.


!op     infix --> infix
    op must not start with '!'
    op must return 'bool', these are the chaining ops and %
        or op can be '='

** Declaring that infix:sym<%> is :returns<Bool> just so this works seems a bit ugly to me. Why not simply define infix:sym<!%>? ** Why is the test for .text eq '=' in there? infix:sym<!=> is already defined.


Rop     infix --> infix
    op must not start with '='

** The restriction seems unneeded and has odd side-effects. It is true that there is no reason to all R== R=:= or R===, since they are the same as their non-reversed selves. But the restriction means that:
        Rp5=> is an operator, but R=> is not
        R:=   is an operator, but R=  is not
In the first case, I'd imagine I'd want them both to be. In the second, I imagine I'd want neither -- but not sure I care all that much.


Xop     infix --> infix
op<<      prefix --> prefix
>>op      postfix --> postfix
>>op<<      infix --> infix

++ No restrictions here... Woot!


[op]    infix --> prefix
    op can't be :assoc('non')
    op can't have same precedence as %conditional

** The second test should probably be can't be :assoc('chain')
** Really, the restriction on the operator is that it has to return a type that is compatible with being on its left side for a given type on its right. There are things that are currently allowed here, like [:=] or [=>] that may not make much sense. Perhaps there should be :reduce like there is :assign to indicate which are

        - MtnViewMark


Reply via email to