On 8/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

+To return from other types of code structures, the C<leave> function
+is used.  The first argument, if supplied, specifies a C<Selector>
+for the control structure to leave.  The C<Selector> and will be
+smart-matched against the dynamic scope objects from inner to outer.
+The first that matches is the scope that is left.

s/and //

+As with module and class declarations, a sub or method declaration
+ending in semicolon is allowed at the outermost file scope if it is the
+first such declaration, in which case the rest of the file is the body:
+
+    sub MAIN ($directory, :$verbose, *%other, [EMAIL PROTECTED]);
+    for @filenames { ... }
+
+Proto or multi definitions may not be written in semicolon form,
+nor may C<MAIN> subs within a module or class.  (A C<MAIN> routine
+is allowed in a module or class, but is not usually invoked unless
+the file is run directly (see a above).  This corresponds to the
+"unless caller" idiom of Perl 5.)  In general, you may have only one
+semicolon-style declaration that controls the whole file.

Should the following text now be removed from S06:

====================
--- S06.pod.orig        2006-08-11 11:50:46.000000000 +0300
+++ S06.pod     2006-08-11 11:51:08.000000000 +0300
@@ -159,14 +159,6 @@

    sub foo {...}     # Yes, those three dots are part of the actual syntax

-The old Perl 5 form:
-
-    sub foo;
-
-is a compile-time error in Perl 6 (because it would imply that the body of the
-subroutine extends from that statement to the end of the file, as C<class> and
-C<module> declarations do).
-
Redefining a stub subroutine does not produce an error, but redefining
an already-defined subroutine does. If you wish to redefine a defined sub,
you must explicitly use the "C<is instead>" trait.
====================

--
Markus Laire

Reply via email to