Skip to content

Commit

Permalink
Fix type formatting for several files.
Browse files Browse the repository at this point in the history
(and some very minor textual cleanups)
  • Loading branch information
coke committed May 20, 2024
1 parent 2deedb5 commit 7084956
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 103 deletions.
4 changes: 2 additions & 2 deletions doc/Programs/01-debugging.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dd %hash, $a;
=end code

Please note that C<dd> will ignore named parameters. You can use a
C<Capture> or C<Array> to force it to dump everything passed to it.
L<C<Capture>|/type/Capture> or L<C<Array>|/type/Array> to force it to dump everything passed to it.

=begin code :ok-test<dd>
dd \((:a(1), :b(2)), :c(3));
Expand All @@ -65,7 +65,7 @@ This can be handy as a cheap trace function.

=head2 Using backtraces

The L<Backtrace|/type/Backtrace> class gets the current call stack, and can return it as
The L<C<Backtrace>|/type/Backtrace> class gets the current call stack, and can return it as
a string:

my $trace = Backtrace.new;
Expand Down
4 changes: 2 additions & 2 deletions doc/Type/Backtrace.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Backtrace {}

A backtrace contains the dynamic call stack, usually leading up to a point where
an exception was thrown, and is a List of L<Backtrace::Frame|/type/Backtrace::Frame> objects. Its
an exception was thrown, and is a List of L<C<Backtrace::Frame>|/type/Backtrace::Frame> objects. Its
default stringification excludes backtrace frames that are deemed unnecessary or
confusing; for example routines like C<&die> are hidden by default. Being a
list, you can also access individual elements.
Expand Down Expand Up @@ -114,7 +114,7 @@ frames, compiler-specific frames, and those from the setting.

multi method list(Backtrace:D:)

Returns a list of L<Backtrace::Frame|/type/Backtrace::Frame> objects for this backtrace.
Returns a list of L<C<Backtrace::Frame>|/type/Backtrace::Frame> objects for this backtrace.

=head2 method summary

Expand Down
10 changes: 5 additions & 5 deletions doc/Type/Bag.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
class Bag does Baggy { }

A C<Bag> is an immutable bag/multiset implementing
L<Associative|/type/Associative>, meaning a collection of distinct
L<C<Associative>|/type/Associative>, meaning a collection of distinct
elements in no particular order that each have an integer weight
assigned to them signifying how many copies of that element are
considered "in the bag". (For I<mutable> bags, see L<BagHash|/type/BagHash> instead.)
considered "in the bag". (For I<mutable> bags, see L<C<BagHash>|/type/BagHash> instead.)

C<Bag>s are often used for performing weighted random selections - see
L<.pick|/routine/pick> and L<.roll|/routine/roll>.
Expand Down Expand Up @@ -69,7 +69,7 @@ values become the associated integer weights:
say $n.values.raku; # OUTPUT: «(1, 4).Seq␤»

Furthermore, you can get a C<Bag> by using bag operators (see next
section) on objects of other types such as L<List|/type/List>, which will
section) on objects of other types such as L<C<List>|/type/List>, which will
act like they internally call C<.Bag> on them before performing the operation.
Be aware of the tight precedence of those operators though, which may
require you to use parentheses around arguments:
Expand Down Expand Up @@ -141,8 +141,8 @@ Creates a new C<Bag> from C<@args>.

=head1 Note on C<reverse> and ordering

This method is inherited from L<Any|/type/Any#routine_reverse>, however,
C<Mix>es do not have an inherent order and you should not trust it
This method is inherited from L<C<Any>|/type/Any#routine_reverse>, however,
L<C<Mix>|/type/Mix>es do not have an inherent order and you should not trust it
returning a consistent output.

=head1 See also
Expand Down
14 changes: 7 additions & 7 deletions doc/Type/BagHash.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ them signifying how many copies of that element are considered "in the
bag". If you do not need the mutability that a C<BagHash> provides,
consider using the I<immutable> L<C«Bag»|/type/Bag> type instead.

An item may be a definite object of any type – not just a C<Str>. For
An item may be a definite object of any type – not just a L<C<Str>|/type/Str>. For
example, you can store L<C«Sub»|/type/Sub>'s in a C<BagHash>, and you
will store the actual C<Sub> rather than a string with the same name
as the C<Sub>. Within a C<BagHash>, items that would compare
will store the actual L<C<Sub>|/type/Sub> rather than a string with the same name
as the L<C<Sub>|/type/Sub>. Within a C<BagHash>, items that would compare
positively with the L<===|/routine/===> operator are considered the
same element, with the number of how many there were as its weight.
Alternatively, you can use the C<kxxv> method to easily get back the
Expand Down Expand Up @@ -164,7 +164,7 @@ say $a ⊎ $b; # OUTPUT: «BagHash(2(3) 4(2) 3(2))␤»
=head1 Note on C<reverse> and ordering.

BagHash inherits C<reverse> from L<Any|/type/Any#routine_reverse>,
however, C<Bag>s do not have an inherent order and you should not trust
however, L<C<Bag>|/type/Bag>s do not have an inherent order and you should not trust
it returning a consistent output.

If you sort a BagHash, the result is a list of pairs, at which point
Expand All @@ -184,9 +184,9 @@ say $a.sort.reverse; # OUTPUT: «(18 => 1 4 => 1 3 => 1 2 => 2)␤»

When C<to-add> is a single item, C<add> inserts it into the C<BagHash>
or, if it was already present, increases its weight by 1. When
C<to-add> is a C<List>, C<Array>, C<Seq>, or any other type that
C<to-add> is a L<C<List>|/type/List>, L<C<Array>|/type/Array>, L<C<Seq>|/type/Seq>, or any other type that
C<does> the L<C«Iterator»|/type/Iterator> Role, C<add> inserts each
element of the C<Iterator> into the C<SetHash> or increments the
element of the L<C<Iterator>|/type/Iterator> into the L<C<SetHash>|/type/SetHash> or increments the
weight of each element by 1.

I<Note:> Added in version 2020.02.
Expand All @@ -199,7 +199,7 @@ When C<to-remove> is a single item, C<remove> reduces the weight of
that item by one. If this results in the item having a weight of 0,
this removes the item from the C<BagHash>. If the item is not present
in the C<BagHash>, C<remove> has no effect. When C<to-remove> is a
C<List>, C<Array>, C<Seq>, or any other type that C<does> the
L<C<List>|/type/List>, L<C<Array>|/type/Array>, L<C<Seq>|/type/Seq>, or any other type that C<does> the
L<C«Iterator»|/type/Iterator> Role, C<remove> reduces the weight of
each element by 1 and removes any items with the resulting weight of
0.
Expand Down
12 changes: 6 additions & 6 deletions doc/Type/Buf.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ cases where it is the best representation for a particular encoding.

method subbuf-rw($from = 0, $elems = self.elems - $from) is rw

A mutable version of C<subbuf> that returns a L<Proxy|/type/Proxy>
A mutable version of C<subbuf> that returns a L<C<Proxy>|/type/Proxy>
functioning as a writable reference to a part of a buffer. Its first
argument, C<$from> specifies the index in the buffer from which a
substitution should occur, and its last argument, C<$elems> specifies
Expand Down Expand Up @@ -110,7 +110,7 @@ inconsistent across different virtual machines.

multi method list(Buf:D:)

Returns a C<List> of integers.
Returns a L<C<List>|/type/List> of integers.

say Buf.new(122,105,112,205).list; # OUTPUT: «(122 105 112 205)␤»

Expand Down Expand Up @@ -198,9 +198,9 @@ These methods are available on the C<buf8> type only. They allow low level
access to writing bytes to the underlying data and in different ways with
regards to type (integer or floating point (num)), size (8, 16, 32, 64 or 128
bits), signed or unsigned (for integer values) and endianness (native, little
and big endianness). These methods always return C<Nil>.
and big endianness). These methods always return L<C<Nil>|/type/Nil>.

Endianness must be indicated by using values of the L<Endian|/type/Endian>
Endianness must be indicated by using values of the L<C<Endian>|/type/Endian>
enum as the B<third> parameter to these methods. If no endianness is
specified, C<NativeEndian> will be assumed. Other values are
C<LittleEndian> and C<BigEndian>.
Expand Down Expand Up @@ -324,7 +324,7 @@ returned to allow for easier chaining of operations on the C<buf8> object.
The buffer will be automatically resized to support any bytes being written
if it is not large enough yet.

Endianness must be indicated by using values of the L<Endian|/type/Endian>
Endianness must be indicated by using values of the L<C<Endian>|/type/Endian>
enum as the B<third> parameter to these methods. If no endianness is
specified, C<NativeEndian> will be assumed. Other values are
C<LittleEndian> and C<BigEndian>.
Expand Down Expand Up @@ -435,6 +435,6 @@ C<BigEndian>.

Available as of the 2021.06 Rakudo compiler release.

Coerces the invocant into an immutable L<Blob|/type/Blob> object.
Coerces the invocant into an immutable L<C<Blob|/type/Blob> object.

=end pod
6 changes: 3 additions & 3 deletions doc/Type/Distribution/Locally.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

Provides read access to specific files pointed at by a distributions metadata,
providing the L<Distribution#method_content|/type/Distribution#method_content>
method for L<Distribution::Path|/type/Distribution::Path> and
L<Distribution::Hash|/type/Distribution::Hash>.
method for L<C<Distribution::Path>|/type/Distribution::Path> and
L<C<Distribution::Hash>|/type/Distribution::Hash>.

=head1 Methods

Expand All @@ -21,7 +21,7 @@ A prefix path to be used in conjuncture with the paths found in the metadata.

Provides L<Distribution#method_content|/type/Distribution#method_content>

Returns an C<IO::Handle> to the file represented by C<$name-path>. C<$name-path>
Returns an L<C<IO::Handle>|/type/IO::Handle> to the file represented by C<$name-path>. C<$name-path>
is a relative path as it would be found in the metadata such as C<lib/Foo.rakumod>
or C<resources/foo.txt>, and these paths will be prefixed with
L<Distribution#method_prefix|#method_prefix>.
Expand Down
10 changes: 5 additions & 5 deletions doc/Type/Distribution/Resource.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ itself, is an instance of C<Distribution::Resources>. These resources are
installed as part of the standard distribution installation process; please
check the definition of C<%?RESOURCES> above for more context.

Externally, every one of these resources behaves as an C<IO::Path>, and it
shares many of the same methods; however, it's really I<not> an C<IO::Path>
Externally, every one of these resources behaves as an L<C<IO::Path>|/type/IO::Path>, and it
shares many of the same methods; however, it's really I<not> an L<C<IO::Path>|/type/IO::Path>
and thus cannot be smartmatched to it.

This variable will work with the current repository chain structure, and will
Expand Down Expand Up @@ -110,7 +110,7 @@ on the type of distribution, and in any case C<.key> will return the name of
the resources pseudo-hash key.

Please note also that accessing the resource via its key will return a handle
on the resource, which gists to a C<IO::Path> but is, in fact, a
on the resource, which gists to a L<C<IO::Path>|/type/IO::Path> but is, in fact, a
C<Distribution::Resource> object. Looking again at the "regular" resources,
the path it translates to will be the same as the one declared in
C<resources> in META6.json, but it will change for "library" resources
Expand All @@ -124,7 +124,7 @@ it represents, such as a file, for instance
=for code
my @data = %?RESOURCES<data/swim.csv>.lines.split(",");

However, this is I<not> because it returns a C<IO::Path>, but because it
However, this is I<not> because it returns a L<C<IO::Path>|/type/IO::Path>, but because it
shares many method with it: C<Str, gist, raku, absolute, is-absolute,
relative, is-relative, parts, volume, dirname, basename, extension, open,
resolve, slurp, lines, comb, split, words, copy>; above we use C<.lines>, for
Expand All @@ -151,7 +151,7 @@ regular resource files.

method IO()

Returns the corresponding resource as an C<IO::Path>, which can effectively
Returns the corresponding resource as an L<C<IO::Path>|/type/IO::Path>, which can effectively
be used as such.

=end pod

0 comments on commit 7084956

Please sign in to comment.