So what's wrong with:

sub foo($param is topic //= $= // 5)    # Shorter form with $=
sub foo($param is topic //= $CALLER::_ // 5) 

It doesn't really seem like we can make it much shorter. Yes, we could
convert //= into a single character, but why? People will understand
//=. 

The idea of $= as CALLER::_ is good, though.

Also, since we're jamming things into the signature, how do we declare
call-by-value/call-by-reference info?

=Austin


--- Allison Randal <[EMAIL PROTECTED]> wrote:
> To summarize, we're discussing 3 features:
> 
> a) the ability to set the topic with a block (sub, method, etc)
> b) the ability to set a default value for a parameter
> c) the ability to break lexical scope
>     1) for $_ only
>     2) for any variable
> 
> Each of these features already have syntax that allows them to be
> used
> independently:
> 
>   # a) set topic
>   sub foo ($param is topic) { ... }
>   # or it's set implicitly to the first parameter
> 
>   # b) default
>   sub foo ($param = 5) { ... }
> 
>   # c) break lexical scope
>   $CALLER::varname
> 
> The propsals all basically boil down to bits of syntactic sugar that
> combine these three features in various ways. 
> 
> The fundamental question for each of the proposals is "What's the
> overall gain for the language in providing syntatic sugar for this
> particular combination of features?"
> 
> Allison

Reply via email to