Permalink
Browse files

Rewrite broken /type links as /routine.

  • Loading branch information...
cfa committed Jan 12, 2019
1 parent 92da032 commit fe72b230390122794244ec7d380b22a8e8f415ba
Showing with 121 additions and 121 deletions.
  1. +5 −5 doc/Language/5to6-perlfunc.pod6
  2. +5 −5 doc/Language/faq.pod6
  3. +1 −1 doc/Language/grammars.pod6
  4. +1 −1 doc/Language/hashmap.pod6
  5. +3 −3 doc/Language/nativecall.pod6
  6. +1 −1 doc/Language/nativetypes.pod6
  7. +4 −4 doc/Language/numerics.pod6
  8. +3 −3 doc/Language/objects.pod6
  9. +19 −19 doc/Language/operators.pod6
  10. +2 −2 doc/Language/phasers.pod6
  11. +2 −2 doc/Language/py-nutshell.pod6
  12. +1 −1 doc/Language/quoting.pod6
  13. +2 −2 doc/Language/structures.pod6
  14. +1 −1 doc/Language/subscripts.pod6
  15. +1 −1 doc/Language/terms.pod6
  16. +5 −5 doc/Language/traps.pod6
  17. +2 −2 doc/Language/unicode.pod6
  18. +1 −1 doc/Language/variables.pod6
  19. +9 −9 doc/Type/Any.pod6
  20. +1 −1 doc/Type/Array.pod6
  21. +1 −1 doc/Type/Backtrace.pod6
  22. +1 −1 doc/Type/Baggy.pod6
  23. +3 −3 doc/Type/CallFrame.pod6
  24. +10 −10 doc/Type/Cool.pod6
  25. +3 −3 doc/Type/Failure.pod6
  26. +1 −1 doc/Type/Hash.pod6
  27. +1 −1 doc/Type/IO/Handle.pod6
  28. +1 −1 doc/Type/IO/Path.pod6
  29. +1 −1 doc/Type/Iterator.pod6
  30. +1 −1 doc/Type/Junction.pod6
  31. +4 −4 doc/Type/List.pod6
  32. +2 −2 doc/Type/Mu.pod6
  33. +1 −1 doc/Type/Num.pod6
  34. +1 −1 doc/Type/Pair.pod6
  35. +1 −1 doc/Type/PositionalBindFailover.pod6
  36. +1 −1 doc/Type/Proc/Async.pod6
  37. +1 −1 doc/Type/Promise.pod6
  38. +1 −1 doc/Type/Real.pod6
  39. +1 −1 doc/Type/Slip.pod6
  40. +7 −7 doc/Type/Str.pod6
  41. +1 −1 doc/Type/Telemetry/Sampler.pod6
  42. +1 −1 doc/Type/Test.pod6
  43. +1 −1 doc/Type/X/Comp.pod6
  44. +1 −1 doc/Type/X/IO/Chdir.pod6
  45. +3 −3 doc/Type/X/IO/Mkdir.pod6
  46. +2 −2 doc/Type/X/IO/Move.pod6
@@ -181,7 +181,7 @@ L<here|/language/control#proceed>.
=item caller EXPR
There are a couple different ways to get at caller information in Perl 6.
The basic functionality is provided through L<callframe|/type/callframe> now. However, Perl 6
The basic functionality is provided through L<callframe|/routine/callframe> now. However, Perl 6
constructs call frames for regular blocks, not just for subroutines, so there
are more frames to look through. The following will retrieve the basic
information that C<caller> can return:
@@ -218,7 +218,7 @@ as much as possible.
Works as it does in Perl 5 but B<must> take an argument. The behaviour
of C<chdir()> (with regards to looking at HOME and LOGDIR) is not supported.
In Perl 6, L<chdir|/type/chdir> only changes the C<$*CWD> dynamic variable. It does
In Perl 6, L<chdir|/routine/chdir> only changes the C<$*CWD> dynamic variable. It does
B<not> actually change the default directory from the OS's point of view; the
special dynamic-variable routine L«C<&*chdir>|/routine/&*chdir» can be used
for that, if needed.
@@ -747,7 +747,7 @@ IO::Socket object, but details are unclear.
=item glob EXPR
Not available in core, although some of the functionality is offered by
L<dir|/type/dir> routine and its C<test> argument.
L<dir|/routine/dir> routine and its C<test> argument.
See L«C<IO::Glob> module in ecosystem|https://modules.perl6.org/dist/IO::Glob»
@@ -949,7 +949,7 @@ much as possible.
=item link OLDFILE, NEWFILE
See L<link|/type/link>
See L<link|/routine/link>
=head2 listen
@@ -1146,7 +1146,7 @@ only, read-write, and append, you would use C<:w>, C<:rw>, and C<:a>
respectively. There are also options for encoding and how the filehandle
deals with newlines. Details L<here|/routine/open>.
Another important change is that filehandles don't get automatically closed on scope exit. It's necessary to call L<close|/type/close> explicitly.
Another important change is that filehandles don't get automatically closed on scope exit. It's necessary to call L<close|/routine/close> explicitly.
=head2 opendir
@@ -277,14 +277,14 @@ X<|Data::Dumper (FAQ)>
=head2 How can I dump Perl 6 data structures
(like Perl 5 Data::Dumper and similar)?
Typical options are to use L<say|/type/say> routine that uses L<gist|/type/gist> method that
Typical options are to use L<say|/routine/say> routine that uses L<gist|/routine/gist> method that
gives the "gist" of the object being dumped. More detailed output can be
obtained by calling L<perl|/type/perl> method that typically returns representation
obtained by calling L<perl|/routine/perl> method that typically returns representation
in L<EVAL|/routine/EVAL>-able code.
If you're using the L<rakudo|https://rakudo.org> implementation, you can use
the L«rakudo-specific C<dd> routine|/programs/01-debugging#Dumper_function_dd»
for dumping, whose output is similar to L<perl|/type/perl>, but with more information.
for dumping, whose output is similar to L<perl|/routine/perl>, but with more information.
Examples:
@@ -348,10 +348,10 @@ say $bar; # OUTPUT: «70␤»
=end code
To test whether a variable has any defined values, see
L<DEFINITE|/language/classtut#index-entry-.DEFINITE> and L<defined|/type/defined>
L<DEFINITE|/language/classtut#index-entry-.DEFINITE> and L<defined|/routine/defined>
routines. Several other constructs exist that test for definiteness, such as
L«C<with>, C<orwith>, and C<without>|/syntax/with%20orwith%20without»
statements, L«C<//>|/routine/$SOLIDUS$SOLIDUS», L<andthen|/type/andthen>, L<notandthen|/routine/notandthen>, and
statements, L«C<//>|/routine/$SOLIDUS$SOLIDUS», L<andthen|/routine/andthen>, L<notandthen|/routine/notandthen>, and
L<orelse|/routine/orelse> operators, as well as L<type constraint smileys|/type/Signature#Constraining_defined_and_undefined_values>.
=head2 What is C<so>?
@@ -518,7 +518,7 @@ Here is a contrived example of a grammar and actions in action:
=end code
An instance of C<TestActions> is passed as named argument C<actions> to the
L<parse|/type/parse> call, and when token C<TOP> has matched successfully,
L<parse|/routine/parse> call, and when token C<TOP> has matched successfully,
it automatically calls method C<TOP>, passing the match object as an argument.
To make it clear that the argument is a match object, the example uses C<$/>
@@ -309,7 +309,7 @@ is never L<===> to another.
say $first-instant === %intervals.keys.sort[0]; # OUTPUT: «True␤»
Since C<Instant> defines its own comparison methods, in our example a sort
according to L<cmp|/type/cmp> will always provide the earliest instant object as the first
according to L<cmp|/routine/cmp> will always provide the earliest instant object as the first
element in the L<List|/type/List> it returns.
If you would like to accept any object whatsoever in your hash, you can use L<Any|/type/Any>!
@@ -126,8 +126,8 @@ say "$result, $this-time"; # OUTPUT: «0, timespec<65385480>␤»
=end code
The L<original function we are calling,
L<clock_gettime|/type/clock_gettime>|https://linux.die.net/man/3/clock_gettime>, uses a pointer to
the C<timespec> struct as second argument. We declare it as a L<class|/type/class> here, but
L<clock_gettime|/routine/clock_gettime>|https://linux.die.net/man/3/clock_gettime>, uses a pointer to
the C<timespec> struct as second argument. We declare it as a L<class|/syntax/class> here, but
specify its representation as C<is repr('CStruct')>, to indicate it corresponds
to a C data structure. When we create an object of that class, we are creating
exactly the kind of pointer C<clock_gettime> expects. This way, data can be
@@ -1141,4 +1141,4 @@ AF_INET6 SOCK_RAW
=end pod

# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6
@@ -143,7 +143,7 @@ my Pointer[void] $for-malloc = malloc( 32 );
say $for-malloc.perl;
=end code
You can also L<nativecast|/type/nativecast> L<Blob|/type/Blob>s to this kind of pointer in case you need to
You can also L<nativecast|/routine/nativecast> L<Blob|/type/Blob>s to this kind of pointer in case you need to
work with them in native functions that use the type
=begin code
@@ -81,10 +81,10 @@ L<Num|/type/Num> literal and does offer support for negative zero and
L<denormals|https://en.wikipedia.org/wiki/Denormal_number> (also known as
"subnormals").
Keep in mind that output routines like L<say|/type/say> or L<put|/routine/put> do not try very hard to
Keep in mind that output routines like L<say|/routine/say> or L<put|/routine/put> do not try very hard to
distinguish between how L<Numeric|/type/Numeric> types are output and may choose to display
a L<Num|/type/Num> as an L<Int|/type/Int> or a L<Rat|/type/Rat> number. For a more definitive string to
output, use the L<perl|/type/perl> method:
output, use the L<perl|/routine/perl> method:
=begin code
say 1e0; # OUTPUT: «1␤»
@@ -242,10 +242,10 @@ say (1🙼3).perl; # OUTPUT: «FatRat.new(1, 3)␤»
=head2 Printing rationals
Keep in mind that output routines like L<say|/type/say> or L<put|/routine/put> do not try very hard to
Keep in mind that output routines like L<say|/routine/say> or L<put|/routine/put> do not try very hard to
distinguish between how L<Numeric|/type/Numeric> types are output and may choose to display
a L<Num|/type/Num> as an L<Int|/type/Int> or a L<Rat|/type/Rat> number. For a more definitive string to
output, use the L<perl|/type/perl> method:
output, use the L<perl|/routine/perl> method:
=begin code
say 1.0; # OUTPUT: «1␤»
@@ -551,7 +551,7 @@ X<|new (method)>
Objects are generally created through method calls, either on the type
object or on another object of the same type.
Class L<Mu|/type/Mu> provides a constructor method called L<new|/type/new>, which takes named
Class L<Mu|/type/Mu> provides a constructor method called L<new|/routine/new>, which takes named
L<arguments|/language/functions#Arguments> and uses them to initialize public
attributes.
@@ -668,7 +668,7 @@ say RectangleWithCachedArea.new( x2 => 5, x1 => 1, y2 => 1, y1 => 0).area;
=head2 Object cloning
The cloning is done using the L<clone|/type/clone> method available on all objects, which
The cloning is done using the L<clone|/routine/clone> method available on all objects, which
shallow-clones both public and private attributes. New values for I<public>
attributes can be supplied as named arguments.
@@ -684,7 +684,7 @@ attributes can be supplied as named arguments.
say $o2; # Foo.new(foo => 42, bar => 5000)
=end code
See document for L<clone|/type/clone> for details on how non-scalar attributes get cloned,
See document for L<clone|/routine/clone> for details on how non-scalar attributes get cloned,
as well as examples of implementing your own custom clone methods.
=head1 X<Roles|declarator,role>
@@ -385,7 +385,7 @@ X<|[] (reduction metaoperators)>X<|[+] (reduction metaoperators)>
=head1 Reduction metaoperators
The reduction metaoperator, C<[ ]>, reduces a list with the given infix
operator. It gives the same result as the L<reduce|/type/reduce> routine - see there for
operator. It gives the same result as the L<reduce|/routine/reduce> routine - see there for
details.
# These two are equivalent:
@@ -499,7 +499,7 @@ Otherwise it constructs a L<Block|/type/Block>.
To force construction of a L<Block|/type/Block>, follow the opening brace with a semicolon.
To always ensure you end up with a L<Hash|/type/Hash>, you can use C<%( )> coercer or
L<hash|/type/hash> routine instead:
L<hash|/routine/hash> routine instead:
{}.^name.say; # OUTPUT: «Hash␤»
{;}.^name.say; # OUTPUT: «Block␤»
@@ -726,7 +726,7 @@ X<Hyper method call operator>. Will call a method on all elements of a C<List> o
say @a».&foo; # So we can pretend to have a method call with a sub that got a good first positional argument.
say @a».&{ .ord}; # Blocks have an implicit positional arguments that lands in $_. The latter can be omitted for method calls.
Hyper method calls may appear to be the same as doing a L<map|/type/map> call, however
Hyper method calls may appear to be the same as doing a L<map|/routine/map> call, however
along with being a hint to the compiler that it can parallelize the call, the
behaviour is also affected by
L<nodality of the method|/routine/is%20nodal>
@@ -738,7 +738,7 @@ method. If the hyper is applied to a method, that L<Callable|/type/Callable> is
name, looked up on L<List|/type/List> type; if the hyper is applied to a routine (e.g.
C<».&foo>), that routine functions as that L<Callable|/type/Callable>. If the L<Callable|/type/Callable> is
determined to provide C<nodal> method, L<nodemap|/routine/nodemap> semantics are used to perform
the hyper call, otherwise L<duckmap|/type/duckmap> semantics are used.
the hyper call, otherwise L<duckmap|/routine/duckmap> semantics are used.
Take care to avoid a
L<common mistake|/language/traps#Using_»_and_map_interchangeably> of expecting
@@ -828,7 +828,7 @@ Increments its argument by one and returns the updated value.X<|prefix increment
say ++$x; # OUTPUT: «4␤»
say $x; # OUTPUT: «4␤»
It works by calling the L<succ|/type/succ> method (for I<successor>) on its argument,
It works by calling the L<succ|/routine/succ> method (for I<successor>) on its argument,
which gives custom types the freedom to implement their own increment
semantics.
@@ -843,7 +843,7 @@ Decrements its argument by one and returns the updated value.
say --$x; # OUTPUT: «2␤»
say $x; # OUTPUT: «2␤»
It works by calling the L<pred|/type/pred> method (for I<predecessor>) on its argument,
It works by calling the L<pred|/routine/pred> method (for I<predecessor>) on its argument,
which gives custom types the freedom to implement their own decrement
semantics.
@@ -858,7 +858,7 @@ Increments its argument by one and returns the original value.X<|postfix increme
say $x++; # OUTPUT: «3␤»
say $x; # OUTPUT: «4␤»
It works by calling the L<succ|/type/succ> method (for I<successor>) on its argument,
It works by calling the L<succ|/routine/succ> method (for I<successor>) on its argument,
which gives custom types the freedom to implement their own increment
semantics.
@@ -886,7 +886,7 @@ Decrements its argument by one and returns the original value.
say $x--; # OUTPUT: «3␤»
say $x; # OUTPUT: «2␤»
It works by calling the L<pred|/type/pred> method (for I<predecessor>) on its argument,
It works by calling the L<pred|/routine/pred> method (for I<predecessor>) on its argument,
which gives custom types the freedom to implement their own decrement
semantics.
@@ -1459,7 +1459,7 @@ keep that.
Mixes C<$role> into C<$obj> at runtime. Requires C<$obj> to be mutable.
Similar to L<but|/type/but> operator, the C<$role> can instead be an instantiated object,
Similar to L<but|/routine/but> operator, the C<$role> can instead be an instantiated object,
in which case, the operator will create a role for you automatically.
The role will contain a single method named the same as C<$obj.^name>
and that returns C<$obj>:
@@ -2033,22 +2033,22 @@ operand. Short-circuits.
=head2 infix C«min»
Returns the smallest of the arguments, as determined by L<cmp|/type/cmp> semantics.
Returns the smallest of the arguments, as determined by L<cmp|/routine/cmp> semantics.
my $foo = 42;
$foo min= 0 # read as: $foo decreases to 0
=head2 infix C«max»
Returns the largest of the arguments, as determined by L<cmp|/type/cmp> semantics.
Returns the largest of the arguments, as determined by L<cmp|/routine/cmp> semantics.
my $foo = -42;
$foo max= 0 # read as: $foo increases to 0
=head2 infix C«minmax»
Returns the L<Range|/type/Range> starting from the lowest to the highest of the values,
as determined by the L<cmp|/type/cmp> semantics.
as determined by the L<cmp|/routine/cmp> semantics.
For instance:
=begin code
@@ -2075,7 +2075,7 @@ among all available values:
('a','b','z') minmax ('c','d','w'); # "a".."z"
=end code
Similarly, when applied to L<Hash|/type/Hash>es, it performs a L<cmp|/type/cmp> way comparison:
Similarly, when applied to L<Hash|/type/Hash>es, it performs a L<cmp|/routine/cmp> way comparison:
=begin code
my %winner = points => 30, misses => 10;
@@ -2425,7 +2425,7 @@ L<Junctions|/type/Junctions>.
The sequence operator invokes the generator with as many arguments as
necessary. The arguments are taken from the initial elements and the
already generated elements. The default generator is
C<*.>L<succ|/type/succ> or C<*.>L<pred|/type/pred>, depending on how the
C<*.>L<succ|/routine/succ> or C<*.>L<pred|/routine/pred>, depending on how the
end points compare:
say 1 ... 4; # OUTPUT: «(1 2 3 4)␤»
@@ -2595,7 +2595,7 @@ first L<undefined|/routine/defined> argument, otherwise the last
argument. Last argument is returned as-is, without being checked for
definedness at all. Short-circuits. The result of the left side is bound
to C<$_> for the right side, or passed as arguments if the right side is
a L«C<Callable>|/type/Callable», whose L<count|/type/count> must be C<0>
a L«C<Callable>|/type/Callable», whose L<count|/routine/count> must be C<0>
or C<1>.
A handy use of this operator is to alias a routine's return value to C<$_> and
@@ -2635,12 +2635,12 @@ the first L<defined|/routine/defined> argument, otherwise the last argument.
Last argument is returned as-is, without being checked for definedness at all.
Short-circuits. The result of the left side is bound to C<$_> for the
right side, or passed as arguments if the right side is a
L«C<Callable>|/type/Callable», whose L<count|/type/count> must be C<0> or C<1>.
L«C<Callable>|/type/Callable», whose L<count|/routine/count> must be C<0> or C<1>.
At first glance, L<notandthen|/routine/notandthen> might appear to be the same thing as the L<orelse|/routine/orelse>
operator. The difference is subtle: L<notandthen|/routine/notandthen> returns
L«C<Empty>|/type/Slip#index-entry-Empty-Empty» when it encounters a
L<defined|/type/defined> item (that isn't the last item), whereas L<orelse|/routine/orelse> returns that
L<defined|/routine/defined> item (that isn't the last item), whereas L<orelse|/routine/orelse> returns that
item. In other words, L<notandthen|/routine/notandthen> is a means to act when items aren't
defined, whereas L<orelse|/routine/orelse> is a means to obtain the first defined item:
@@ -2689,10 +2689,10 @@ Returns the first defined argument, or else the last argument. Last argument
is returned as-is, without being checked for definedness at all.
Short-circuits. The result of the left side is bound to
C<$_> for the right side, or passed as an argument if the right side is a
L«C<Callable>|/type/Callable», whose L<count|/type/count> must be C<0> or C<1>.
L«C<Callable>|/type/Callable», whose L<count|/routine/count> must be C<0> or C<1>.
This operator is useful for handling L<Failures|/type/Failure> returned by
routines since the expected value is usually L<defined|/type/defined>
routines since the expected value is usually L<defined|/routine/defined>
and L<Failure|/type/Failure> never is:
sub meows { ++$ < 4 ?? fail 'out of meows!' !! '🐱' }
@@ -208,8 +208,8 @@ The return value is available for use in later phases:
# 6-3
The C<^10 .pick> in the phaser is generated only once and is then re-used by the loop
during runtime. Note how the L<say|/type/say> in the C<BEGIN> block is executed before
the L<say|/type/say> that is above the loop.
during runtime. Note how the L<say|/routine/say> in the C<BEGIN> block is executed before
the L<say|/routine/say> that is above the loop.
=head2 X<CHECK|Phasers, CHECK>
@@ -31,8 +31,8 @@ Perl 6
put "Hello, world!"
There is also the L<say|/type/say> keyword, which behaves similarly, but will call
the L<gist|/type/gist> method of its argument.
There is also the L<say|/routine/say> keyword, which behaves similarly, but will call
the L<gist|/routine/gist> method of its argument.
Perl 6
@@ -134,7 +134,7 @@ in your strings, to avoid interpretation of angle brackets as hash keys:
=begin code :allow<B L> :skip-test
my $color = 'blue';
L<say|/type/say> B<">My favorite color is B<$color>!B<">
L<say|/routine/say> B<">My favorite color is B<$color>!B<">
My favorite color is blue!
=end code
@@ -110,14 +110,14 @@ will obtain a different value every time you run it;
L<C<kv>|/type/Pair#method_kv> turns every C<Pair> into a list.
Complex data structures are also generally L<Iterable|/type/Iterable>. Generating an
L<iterator|/type/iterator> out of them will allow the program to visit the first level of the
L<iterator|/routine/iterator> out of them will allow the program to visit the first level of the
structure, one by one:
.say for 'א'..'ס'; # OUTPUT: «א␤ב␤ג␤ד␤ה␤ו␤ז␤ח␤ט␤י␤ך␤כ␤ל␤ם␤מ␤ן␤נ␤ס␤»
C<'א'..'ס'> is a L<Range|/type/Range>, a complex data structure, and with C<for> in front it
will iterate until the list is exhausted. You can use C<for> on your complex
data structures by overriding the L<iterator|/type/iterator> method (from role C<Iterable>):
data structures by overriding the L<iterator|/routine/iterator> method (from role C<Iterable>):
class SortedArray is Array {
method iterator() {
@@ -321,7 +321,7 @@ object) or an empty list (which returns an empty slice):
say %bag{()}; # OUTPUT: «()␤»
Zen slicing does not
L<reify|/language/glossary#index-entry-Reify> or L<cache|/type/cache> and merely
L<reify|/language/glossary#index-entry-Reify> or L<cache|/routine/cache> and merely
returns the invocant. It is usually used to
L<interpolate|/language/quoting#Interpolation:_qq> entire arrays / hashes into
strings or to L<decont|/language/glossary#index-entry-decont>.
Oops, something went wrong.

0 comments on commit fe72b23

Please sign in to comment.