Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Clarify when prefix<::> can be used as in-place predeclarator #10

Merged
merged 5 commits into from Dec 1, 2012
View
@@ -804,13 +804,13 @@ order of arguments with the same name. When there are more than one
argument, the C<@> sigil in the parameter list causes the arguments
to be concatenated:
- sub fun (Int @x) { ... }
+ sub fun (Int :@x) { ... }
fun( x => 1, x => 2 ); # @x := (1, 2)
fun( x => (1, 2), x => (3, 4) ); # @x := (1, 2, 3, 4)
Other sigils bind only to the I<last> argument with that name:
- sub fun (Int $x) { ... }
+ sub fun (Int :$x) { ... }
fun( x => 1, x => 2 ); # $x := 2
fun( x => (1, 2), x => (3, 4) ); # $x := (3, 4)
View
@@ -46,10 +46,12 @@ the file is Perl 5 code.
This form is illegal in a Perl 6 file. If you wish to have a file-scoped package,
either use the brace form or declare it with the C<module> keyword instead.
-Since there are no barewords in Perl 6, package names must be predeclared,
-or use the sigil-like C<::PackageName> syntax to indicate that the type will
-be supplied some other way. The C<::> prefix does not imply globalness as
-it does in Perl 5. (Use C<GLOBAL::> for that.)
+Since there are no barewords in Perl 6, package names must be predeclared.
+Alternatively, the sigil-like C<::PackageName> syntax may be used to indicate
+that the type will be supplied some other way, however this syntax is not valid
+in declarative scenarios, especially parameter lists where it has entirely
+different semantics. The C<::> prefix does not imply globalness as it does in
+Perl 5. (Use C<GLOBAL::> for that.)
A bare C<package> declarator (without an explicit scope declarator
such as C<my>) declares an C<our> package within the current package
View
@@ -1847,7 +1847,7 @@ Such declarational forms are not always convenient; to translate
native enum values back to their names operationally, you can pull
out the enum type's C<EnumMap> and invert it:
- constant %dayname := Day.enums.invert;
+ constant %dayname := day.enums.invert;
%dayname{3} # Wed
=head2 The Enumeration Type