Skip to content

Commit

Permalink
Remove leading indentation from (some) pod code blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
cfa committed Mar 16, 2018
1 parent 75470b4 commit d1c8d8a
Show file tree
Hide file tree
Showing 19 changed files with 964 additions and 964 deletions.
814 changes: 407 additions & 407 deletions doc/Language/5to6-nutshell.pod6

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions doc/Language/5to6-perlfunc.pod6
Expand Up @@ -56,7 +56,7 @@ You can, of course, use an already opened filehandle. Here, using the file
handle C<$fh>, is an example, using the method syntax for the file test:
=for code :preamble<my $fh;>
$fh.r
$fh.r
Most of the former filetests have colon equivalents for use with smart match:
Expand All @@ -76,9 +76,9 @@ All of these tests can be used as methods (without the colon).
Three tests, however, I<only> have method equivalents:
=for code :preamble<my $fh;>
$fh.modified; # -M $fh
$fh.accessed; # -A $fh
$fh.changed; # -C $fh
$fh.modified; # -M $fh
$fh.accessed; # -A $fh
$fh.changed; # -C $fh
The remaining filetests in Perl 5 do not appear to be implemented
in Perl 6.
Expand Down Expand Up @@ -425,8 +425,8 @@ families.)
In Perl 6, this is not a function, but an adverb:
=for code :preamble<no strict;>
%hash{$key}:exists;
@array[$i]:exists;
%hash{$key}:exists;
@array[$i]:exists;
=head2 exit
Expand Down Expand Up @@ -1067,9 +1067,9 @@ L<append method|/type/Array#method_append>.
These survive the transition to Perl 6. Some notes:
=for code
q/.../; # is still equivalent to using single quotes.
qq/.../; # is still equivalent to using double quotes.
qw/.../; # is more commonly rendered as C<< <...> >> in Perl 6.
q/.../; # is still equivalent to using single quotes.
qq/.../; # is still equivalent to using double quotes.
qw/.../; # is more commonly rendered as C<< <...> >> in Perl 6.
There are some added quoting constructs and equivalents, as explained at
L<quoting|/language/quoting>.
Expand Down
16 changes: 8 additions & 8 deletions doc/Language/faq.pod6
Expand Up @@ -250,12 +250,12 @@ for dumping, whose output is similar to L<perl>, but with more information.
Examples:
=begin code :ok-test<dd>
my $foo = %( foo => 'bar' );
say $foo.perl; # OUTPUT: «${:foo("bar")}␤»
say $foo; # OUTPUT: «{foo => bar}␤»
my $foo = %( foo => 'bar' );
say $foo.perl; # OUTPUT: «${:foo("bar")}␤»
say $foo; # OUTPUT: «{foo => bar}␤»
# non-standard routine available in rakudo implementation:
dd $foo; # OUTPUT: «Hash $foo = ${:foo("bar")}␤»
# non-standard routine available in rakudo implementation:
dd $foo; # OUTPUT: «Hash $foo = ${:foo("bar")}␤»
=end code
There are also L<several ecosystem modules|https://modules.perl6.org/s/dump>
Expand All @@ -281,11 +281,11 @@ otherwise it's runtime.
Example:
=for code
say 1/0; # Attempt to divide 1 by zero using div
say 1/0; # Attempt to divide 1 by zero using div
=begin code :skip-test<compile time error>
sub foo( Int $a, Int $b ) {...}
foo(1) # ===SORRY!=== Error while compiling ...
sub foo( Int $a, Int $b ) {...}
foo(1) # ===SORRY!=== Error while compiling ...
=end code
=head2 What is C<(Any)>?
Expand Down
34 changes: 17 additions & 17 deletions doc/Language/glossary.pod6
Expand Up @@ -96,11 +96,11 @@ L<Complex>). This allows you to use such literals in places where
expressions are not allowed, for example, as literals in signatures:
=for code :skip-test
# Wrong, can't use an operator there:
multi foo (1/3) { say "It's one third!" }
# Wrong, can't use an operator there:
multi foo (1/3) { say "It's one third!" }
=for code
# Right, a Rat literal:
multi foo (<1/3>) { say "It's one third!" }
# Right, a Rat literal:
multi foo (<1/3>) { say "It's one third!" }
If you I<do> want an allomorph and not a literal L<Numeric>,
then include whitespace around angle brackets:
Expand Down Expand Up @@ -881,10 +881,10 @@ a L<Seq>. The following code contains a bug; keeping reification in mind, try to
spot it:
=for code
my $fh = "/tmp/bar".IO.open;
my $lines = $fh.lines;
close $fh;
say $lines[0];
my $fh = "/tmp/bar".IO.open;
my $lines = $fh.lines;
close $fh;
say $lines[0];
We open a L<file handle|/type/IO::Handle>, then assign return of
L«C<.lines>|/type/IO::Handle#method_lines» to a L<Scalar> variable, so the
Expand All @@ -900,19 +900,19 @@ a C<@>-sigiled variable or call L«C<.elems>|/routine/elems» on C<$lines> befor
closing the handle:
=for code
my $fh = "/tmp/bar".IO.open;
my @lines = $fh.lines;
close $fh;
say @lines[0]; # no problem!
my $fh = "/tmp/bar".IO.open;
my @lines = $fh.lines;
close $fh;
say @lines[0]; # no problem!
Also good:
=for code
my $fh = "/tmp/bar".IO.open;
my $lines = $fh.lines;
say "Read $lines.elems() lines"; #reifying before closing handle
close $fh;
say $lines[0]; # no problem!
my $fh = "/tmp/bar".IO.open;
my $lines = $fh.lines;
say "Read $lines.elems() lines"; #reifying before closing handle
close $fh;
say $lines[0]; # no problem!
=head1 Repository
X<|Repository>
Expand Down
4 changes: 2 additions & 2 deletions doc/Language/list.pod6
Expand Up @@ -24,8 +24,8 @@ with parentheses, so:
There is one exception, empty lists are created with just parenthesis:
=for code :skip-test
(); # This is an empty List
(,); # This is a syntax error
(); # This is an empty List
(,); # This is a syntax error
Note that hanging commas are just fine as long as the beginning and
end of a list are clear, so feel free to use them for easy code editing.
Expand Down
34 changes: 17 additions & 17 deletions doc/Language/operators.pod6
Expand Up @@ -940,12 +940,12 @@ In most cases, this behaves identically to the postfix mutator, but the
precedence is lower:
=for code :skip-test
my $a = -5
say ++$a.=abs
# OUTPUT: «6␤»
say ++$a .= abs
# OUTPUT: «Cannot modify an immutable Int␤
# in block <unit> at <tmp> line 1␤␤»
my $a = -5
say ++$a.=abs
# OUTPUT: «6␤»
say ++$a .= abs
# OUTPUT: «Cannot modify an immutable Int␤
# in block <unit> at <tmp> line 1␤␤»
=head2 infix C«.»
Expand Down Expand Up @@ -2406,16 +2406,16 @@ item. In other words, L<notandthen> is a means to act when items aren't
defined, whereas L<orelse> is a means to obtain the first defined item:
=begin code
sub all-sensors-down { [notandthen] |@_, True }
sub first-working-sensor { [orelse] |@_, 'default sensor' }
sub all-sensors-down { [notandthen] |@_, True }
sub first-working-sensor { [orelse] |@_, 'default sensor' }
all-sensors-down Nil, Nil, Nil
and say 'OMG! All sensors are down!'; # OUTPUT:«OMG! All sensors are down!␤»
say first-working-sensor Nil, Nil, Nil; # OUTPUT:«default sensor␤»
all-sensors-down Nil, Nil, Nil
and say 'OMG! All sensors are down!'; # OUTPUT:«OMG! All sensors are down!␤»
say first-working-sensor Nil, Nil, Nil; # OUTPUT:«default sensor␤»
all-sensors-down Nil, 42, Nil
and say 'OMG! All sensors are down!'; # No output
say first-working-sensor Nil, 42, Nil; # OUTPUT:«42␤»
all-sensors-down Nil, 42, Nil
and say 'OMG! All sensors are down!'; # No output
say first-working-sensor Nil, 42, Nil; # OUTPUT:«42␤»
=end code
The C<andthen> operator is a close relative of
Expand All @@ -2424,10 +2424,10 @@ compile C<without> to C<notandthen>, meaning these two lines have equivalent
behaviour:
=begin code
sub good-things { fail }
sub good-things { fail }
'boo'.say without good-things;
good-things() notandthen 'boo'.say;
'boo'.say without good-things;
good-things() notandthen 'boo'.say;
=end code
=head1 Loose OR Precedence
Expand Down
38 changes: 19 additions & 19 deletions doc/Language/phasers.pod6
Expand Up @@ -20,31 +20,31 @@ them respond to various control exceptions and exit values.
Here is a summary:
=begin code :skip-test
BEGIN {...} # * at compile time, ASAP, only ever runs once
CHECK {...} # * at compile time, ALAP, only ever runs once
INIT {...} # * at run time, ASAP, only ever runs once
END {...} # at run time, ALAP, only ever runs once
BEGIN {...} # * at compile time, ASAP, only ever runs once
CHECK {...} # * at compile time, ALAP, only ever runs once
INIT {...} # * at run time, ASAP, only ever runs once
END {...} # at run time, ALAP, only ever runs once
ENTER {...} # * at every block entry time, repeats on loop blocks.
LEAVE {...} # at every block exit time (even stack unwinds from exceptions)
KEEP {...} # at every successful block exit, part of LEAVE queue
UNDO {...} # at every unsuccessful block exit, part of LEAVE queue
ENTER {...} # * at every block entry time, repeats on loop blocks.
LEAVE {...} # at every block exit time (even stack unwinds from exceptions)
KEEP {...} # at every successful block exit, part of LEAVE queue
UNDO {...} # at every unsuccessful block exit, part of LEAVE queue
FIRST {...} # at loop initialization time, before any ENTER
NEXT {...} # at loop continuation time, before any LEAVE
LAST {...} # at loop termination time, after any LEAVE
FIRST {...} # at loop initialization time, before any ENTER
NEXT {...} # at loop continuation time, before any LEAVE
LAST {...} # at loop termination time, after any LEAVE
PRE {...} # assert precondition at every block entry, before ENTER
POST {...} # assert postcondition at every block exit, after LEAVE
PRE {...} # assert precondition at every block entry, before ENTER
POST {...} # assert postcondition at every block exit, after LEAVE
CATCH {...} # catch exceptions, before LEAVE
CONTROL {...} # catch control exceptions, before LEAVE
CATCH {...} # catch exceptions, before LEAVE
CONTROL {...} # catch control exceptions, before LEAVE
LAST {...} # supply tapped by whenever-block is done, runs very last
QUIT {...} # catch async exceptions within a whenever-block, runs very last
LAST {...} # supply tapped by whenever-block is done, runs very last
QUIT {...} # catch async exceptions within a whenever-block, runs very last
COMPOSE {...} # when a role is composed into a class
CLOSE {...} # appears in a supply block, called when the supply is closed
COMPOSE {...} # when a role is composed into a class
CLOSE {...} # appears in a supply block, called when the supply is closed
=end code
Phasers marked with a C<*> have a run-time value, and if evaluated earlier than
Expand Down
2 changes: 1 addition & 1 deletion doc/Language/pragmas.pod6
Expand Up @@ -123,7 +123,7 @@ C<strict> is the default behavior, and requires that you declare variables
before using them. You can relax this restriction with C<no>.
=for code
no strict; $x = 42; # OK
no strict; $x = 42; # OK
=item X<B<trace>|trace>
Expand Down

0 comments on commit d1c8d8a

Please sign in to comment.