Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
X::Placeholder::Mailine. Explain "mainline" in the glossary
  • Loading branch information
moritz committed Aug 17, 2012
1 parent 13d7f52 commit 3e51487
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/X/Placeholder/Mainline.pod
@@ -0,0 +1,18 @@
=begin pod
=TITLE X::Placeholder::Mainline
class X::Placeholder::Mainline is X::Placeholder::Block
Thrown when a placeholder variable is used in the mainline, i.e. outside of
any explicit block.
Example:
$^x
Produces the error message
Cannot use placeholder parameter $^x in the mainline
=end pod
9 changes: 9 additions & 0 deletions lib/glossary.pod
Expand Up @@ -109,6 +109,15 @@ Examples of things that are not lvalues
sub f { }; f(); # "normal" subs are not writable
sub f($x) { $x = 3 }; # error - parameters are read-only by default
=head1 Mainline
The C<mainline> is the program text that is not part of any kind of block.
use v6; # mainline
sub f {
# not in mainline, in sub f
}
f(); # in mainline again
=head1 Slurpy
Expand Down

0 comments on commit 3e51487

Please sign in to comment.