On 10/7/05, Juerd <[EMAIL PROTECTED]> wrote:
> Miroslav Silovic skribis 2005-10-07 13:07 (+0200):
> > Can an inline role be named?
> > 0 but role is_default {}
>
> This is a nice idea. It would require named roles (and to really be
> succesful, also classes, subs, methods, ...) declarations to be
> expressions, but I see no downside to that.
Well, I see a cognitive downside. That is, package declarations (the
default) don't create closures. It's like this:
sub foo($x) {
sub bar() {
return $x;
}
return &bar;
}
foo(42).(); # ????
Restricting expressions to anonymous subs forces you to say what you
mean. Because sometimes when you say:
0 but role is_default { }
You're going to mean package role, and some of the time you're going
to mean lexical. I'd be more in favor of:
0 but my role is_default { }
In fact, it may be the case that that's already valid.
Luke