Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove code formats from code blocks
Also change the 5to6-perlfunc#sprintf code blocks to table;
since it was not code, syntax highlighting made it look weird.

Ref:
3bff9ad
b9434b1
  • Loading branch information
4d47 committed Mar 24, 2016
1 parent 4322e22 commit 1e8490e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
46 changes: 25 additions & 21 deletions doc/Language/5to6-perlfunc.pod
Expand Up @@ -56,12 +56,12 @@ traditional way (although you can) to do a filetest. You can simply append
C<.IO> to the filename. For instance, here is how to check if a file is
readable using smart match:
C<'/path/to/file'.IO ~~ :r>
'/path/to/file'.IO ~~ :r
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:
C<$fh.r>
$fh.r
Most of the former filetests have colon equivalents for use with smart match:
Expand All @@ -79,9 +79,9 @@ All of these tests can be used as methods (without the colon).
Three tests, however, I<only> have method equivalents:
C<-M $fh> => C<$fh.modified>
C<-A $fh> => C<$fh.accessed>
C<-C $fh> => C<$fh.changed>
$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 @@ -130,8 +130,8 @@ find a true analog.
Available as a function as well as being able to be used as a method.
For instance, these are equivalent:
C<atan2(100)>
C<100.atan2>
atan2(100);
100.atan2;
=head2 bind
Expand Down Expand Up @@ -229,8 +229,8 @@ Similar to the Perl 5 version, coerces the target to an integer, and uses that
as a Unicode code point to return the relevant character. Can be used as a
function and a method:
C<chr(65); # "A">
C<65.chr; # "A">
chr(65); # "A"
65.chr; # "A"
=head2 chroot
Expand Down Expand Up @@ -389,8 +389,8 @@ shell($command);>
In Perl 6, this is not a function, but an adverb:
C<%hash{$key}:exists;>
C<@array[$i]:exists;>
%hash{$key}:exists;
@array[$i]:exists;
=head2 exit
Expand Down Expand Up @@ -881,9 +881,9 @@ deals with newlines. Details at L<https://doc.perl6.org/routine/open>.
Not a builtin function in Perl 6. You would use the IO::Path class:
C<my $dir = IO::Path.new("directory")>
my $dir = IO::Path.new("directory");
C<my $dir = "directory".IO; # Same, but probably more direct>
my $dir = "directory".IO; # Same, but probably more direct
=head2 ord
Expand Down Expand Up @@ -1015,9 +1015,9 @@ L<append method|/type/Array#method_append>.
These survive the transition to Perl 6. Some notes:
C<q/.../> is still equivalent to using single quotes.
C<qq/.../> is still equivalent to using double quotes.
C<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<https://doc.perl6.org/language/quoting>.
Expand Down Expand Up @@ -1370,6 +1370,7 @@ described above.
Works as in Perl 5. The formats currently available are:
=table
% a literal percent sign
c a character with the given codepoint
s a string
Expand All @@ -1386,6 +1387,7 @@ Works as in Perl 5. The formats currently available are:
Compatibility:
=table
i a synonym for %d
D a synonym for %ld
U a synonym for %lu
Expand All @@ -1394,17 +1396,19 @@ Compatibility:
Perl 5 (non-)compatibility:
=table
n produces a runtime exception
p produces a runtime exception
There are modifiers for integers, but they're mainly no-ops, as the
semantics aren't settled:
h interpret integer as native "short" (typically int16)
l interpret integer as native "long" (typically int32 or int64)
ll interpret integer as native "long long" (typically int64)
L interpret integer as native "long long" (typically uint64)
q interpret integer as native "quads" (typically int64 or larger)
=table
h interpret integer as native "short" (typically int16)
l interpret integer as native "long" (typically int32 or int64)
ll interpret integer as native "long long" (typically int64)
L interpret integer as native "long long" (typically uint64)
q interpret integer as native "quads" (typically int64 or larger)
=head2 sqrt
Expand Down
4 changes: 2 additions & 2 deletions doc/Language/5to6-perlvar.pod
Expand Up @@ -215,8 +215,8 @@ This is somewhat unclear. It probably depends on what you mean by "the name of
the operating system" as S28 has three different suggestions, all of which
give different answers. On my OS X machine at this time...
C<$*KERNEL> gives "darwin (14.3.0)"
C<$*DISTRO> gives "macosx (10.10.3)"
say $*KERNEL; # gives "darwin (14.3.0)"
say $*DISTRO; # gives "macosx (10.10.3)"
Using C<.version> on either of those will give you just the version
number. C<.name> gives the kernel or distro name. Those objects contain
Expand Down

0 comments on commit 1e8490e

Please sign in to comment.