Author: masak
Date: 2009-10-21 10:50:10 +0200 (Wed, 21 Oct 2009)
New Revision: 28870

[S06] third attempt at describing elusive name collision

Modified: docs/Perl6/Spec/S06-routines.pod
--- docs/Perl6/Spec/S06-routines.pod    2009-10-21 08:46:25 UTC (rev 28869)
+++ docs/Perl6/Spec/S06-routines.pod    2009-10-21 08:50:10 UTC (rev 28870)
@@ -503,12 +503,16 @@
 possible on those arguments that are bound to a final slurpy or
 arglist variable.)
-All parameters must either have a unique name (sigil excluded)
-or be anonymous. Declaring a routine having two positionals with exactly
-the same name counts as a compile-time error. Renaming a named parameter
-can also cause forbidden name collisions:
+A signature containing a name collision is considered a compile time
+error. A name collision can occur between positional parameters, between
+named parameters, or between a positional parameter and a named one.
+The sigil is not considered in such a comparison, except in the case of
+two positional parameters -- in other words, a signature in which two
+or more parameters are identical except for the sigil is still OK (but
+you won't be able to pass values by that name).
-    :($a, $a)       # wrong, two a
+    :($a, $a)       # wrong, two $a
+    :($a, @a)       # OK (but don't do that)
     :($a, :a($b))   # wrong, one a, one a through renaming
     :($a, :a(@b))   # wrong 
     :(:$a, :@a)     # wrong

Reply via email to