From: Leopold Toetsch <[EMAIL PROTECTED]>
Date: Sat, 3 Dec 2005 22:50:00 +0100
On Dec 3, 2005, at 20:15, Bob Rogers wrote:
> Excellent; thank you -- and for the other fix especially. But now I
> notice that this is what happens if you put the inner sub first:
Yes. That's what I've written in:
http://groups.google.com/group/perl.perl6.internals/browse_frm/thread/
812c0e2a6afc2c92/03451b76d036f5c0?q=outer+order&rnum=1#03451b76d036f5c0
Searched in perl.perl6.internals outer order
leo
Sorry; I remember reading this now. Please accept the following small
patch to close the documentation gap.
-- Bob
Index: docs/pdds/pdd20_lexical_vars.pod
===================================================================
--- docs/pdds/pdd20_lexical_vars.pod (revision 10322)
+++ docs/pdds/pdd20_lexical_vars.pod (working copy)
@@ -223,17 +223,21 @@
return &a;
}
-The &foo subroutiine is the outer subroutine of &a, but it is not the caller
+The &foo subroutine is the outer subroutine of &a, but it is not the caller
of &a.
In the above example, the definition of the Parrot subroutine implementing &a
must include a notation that it is textually enclosed within &foo. This is a
static attribute of a Subroutine, set at compile time and never changed
thereafter. (Unless you're evil, or Damian. But I repeat myself.) This
-information is given through a ":outer()" subroutine attribute, e.g.:
+information is given through an ":outer()" subroutine attribute, e.g.:
.sub a :outer(foo)
+Note that the "foo" sub B<must> be compiled first; in other words, "foo" must
+appear before "a" in the source text. Compilers can easily do this via
+preorder traversal of lexically-nested subs.
+
=head1 REQUIRED INTERFACES: LEXPAD, LEXINFO, CLOSURE
=head2 LexInfo