Re: nested 'our' subs - senseless?

2008-05-06 Thread TSa
HaloO, David Green wrote: The assignment happens only when foo() is invoked. However, the variable $*Main::inner is declared at compile-time. Similarly, an "our sub inner" inside foo() would declare the name, but you couldn't call inner() until after running foo() --or bar()-- since you can'

Re: nested 'our' subs - senseless?

2008-05-06 Thread David Green
On 2008-May-6, at 6:07 am, TSa wrote: Just to ensure that I get the our behavior right, consider sub foo { our $inner = 3; } sub bar { our $inner = 4; # redeclaration error? } say $inner; Does this print 3 even when foo was never called? No, it throws an error

Re: nested 'our' subs - senseless?

2008-05-06 Thread TSa
HaloO, David Green wrote: On 2008-May-3, at 5:04 pm, John M. Dlugosz wrote: What does this mean? our sub outer () { ... our sub inner () { ... } } inner; # defined? > I don't know why it would be any more illegal than "sub foo { our $var... }". The inner sub would be in the package

Re: nested 'our' subs - senseless?

2008-05-05 Thread David Green
On 2008-May-3, at 5:04 pm, John M. Dlugosz wrote: What does this mean? our sub outer () { ... our sub inner () { ... } } inner; # defined? I think this should be illegal. Nested named subs makes sense for 'my', with the rules of visibility matching the ability to clone the closure

Re: nested 'our' subs - senseless?

2008-05-05 Thread John M. Dlugosz
Jon Lang dataweaver-at-gmail.com |Perl 6| wrote: On Mon, May 5, 2008 at 6:01 AM, John M. Dlugosz <[EMAIL PROTECTED]> wrote: TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: No, because {...} is just a declaration. You can give a definition later in the surrounding module/package/class.

Re: nested 'our' subs - senseless?

2008-05-05 Thread Jon Lang
On Mon, May 5, 2008 at 6:01 AM, John M. Dlugosz <[EMAIL PROTECTED]> wrote: > TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: > > > > > No, because {...} is just a declaration. You can give a > > definition later in the surrounding module/package/class. > > Within that scope there can be only one d

Re: nested 'our' subs - senseless?

2008-05-05 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: No, because {...} is just a declaration. You can give a definition later in the surrounding module/package/class. Within that scope there can be only one definition, of course. I did not mean to use { ... } to mean declaration only, but to show

Re: nested 'our' subs - senseless?

2008-05-05 Thread TSa
HaloO, John M. Dlugosz wrote: What does this mean? our sub outer () { ... our sub inner () { ... } } inner; # defined? No, because {...} is just a declaration. You can give a definition later in the surrounding module/package/class. Within that scope there can be only one definit

nested 'our' subs - senseless?

2008-05-03 Thread John M. Dlugosz
What does this mean? our sub outer () { ... our sub inner () { ... } } inner; # defined? I think this should be illegal. Nested named subs makes sense for 'my', with the rules of visibility matching the ability to clone the closure. But putting the nested sub into package scope