Dave Whipp writes:
> "Damian Conway" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >      type KeyExtractor ::= Code(Any) returns Any;
> 
> >      # Modtimewise numerically ascending...
> >      @sorted = sort {-M} @unsorted;
> 
> 
> One thing I've been trying to figure out reading this: what is the signature
> of prefix:-M ? 

Presumably something like:

    sub prefix:-M (?$file = $CALLER::_) {...}

> i.e. how does it tell the outer block that it (the outer-block) needs
> a parameter? 

Because it operates on $_.  It tells it the same way:

    map { .name } @objects

Does.  Of course, this is going to be tough on the compiler, who will
have to take the C<= $CALLER::_> part into account.

> There seems to be some transitive magic going on here.  Could similar
> magic be used to have infix:<=> require two higher-order variables
> (e.g. could "sort { <=> } @unsorted" be made to work?)

No.  Although you could do such a thing with:

    sort &infix:<=>, @unsorted;

Luke

Reply via email to