Dan writes:
>     sub foo :come_from('+', int, int) {}

One problem with MMD in general, and return specifically, is
'what happens if multiple M match the same D requirements?
i.e., 

sub foo :come_from('+', int, int) { shift; shift builtin::+ shift };
sub bar :come_from('+', int, int) { shift; shift builtin::* shift };

If the answer is 'all get executed', this could be useful for
any languages interested in implementing aspect-oriented programming
as a first class language feature, e.g.

sub debug_log :come_from(:benchmark_me) { 
    my $function_name = shift;
    print STDERR "debug: $function_name at " . time() . "\n";
}

sub notify_with_pager :come_from(:notify_me) {
    ...
}

sub foo :benchmark_me { ... } # gets benchmarked
sub bar :benchmark_me :notify_with_pager { ... } # benched and notified
sub baz { ... } # not so much with the benchmarking


If the answer is 'the second match is a syntax error'...well,
that spoils the fun, but who said talking about continuations was
supposed to be fun?

F.

Reply via email to