Larry wrote:
On Wed, Mar 19, 2003 at 01:07:32PM +1100, Damian Conway wrote:
: >I specifically avoided "type" or "kind" because I didn't want to imply
: >mere type matching when something more general might be happening,
: >such as smart matching, of which type matching is a small subset.
: : So maybe $which would be better???


Dunno.  That's a bike shed compared to the fact that I'm regretting
bifurcating return into return/leave because of the loss of context
on the args to leave.  I've been wondering idly whether we might have
a generic "where" modifier of some sort:

    return @foo where Block;
    want Lazy where Method;
    caller where .label eq "MAINLOOP";
    type Int where not $_ % 2

But it's not entirely clear whether there's a general constraint
mechanism lurking in there somewhere.  I need to think about that
when I'm smarter, or when someone else is smarter.

Alternatively, this might be an ideal spot for adverbs:


        return :Block @foo;
        want :Method Lazy;
        caller :{.label eq 'MAINLOOP"};
        
Or maybe C<where> is just the way we spell the adverb specifier?

Or just use methods:

        Block.return(@foo);
        Method.want(Lazy);
        Whence({.label eq 'MAINLOOP"}).caller;

which, of course, can also look like:

        return Block: @foo;
        want Method: Lazy;
        caller Whence({.label eq 'MAINLOOP"}:;

Damian



Reply via email to