Skip to content

Commit 3ad88e5

Browse files
committed
Includes links to new definition from various places.
Also reflows those pages, and adds regex behavior of \n. I would say this really closes #1092, if everyone is satisfied with it.
1 parent f933539 commit 3ad88e5

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

doc/Language/newline.pod6

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ rules to handle this. Perl 6 has the following ones:
1111
=item C<\n> in a string literal means Unicode codepoint 10.
1212
1313
=item The default L<nl-out|/routine/nl-out> that is appended to a string by say
14-
is also C<\n>
14+
is also C<\n>.
1515
1616
=item On output, when on Windows, the encoder will by default transform a C<\n>
1717
into a C<\r\n> when it's going to a file, process, or terminal (it won't do this
@@ -41,6 +41,11 @@ C<:nl-out> attribute when you create that handle.
4141
$*OUT.say: 1; #OUTPUT: «1␤»
4242
$crlf-out.say: 1; #OUTPUT: «1\␤␍»
4343
44+
In this example, where we are replicating standard output to a new handle by
45+
using L<IO::Special>, we are appending a C<\> to the end of the string, followed
46+
by a newline C<> and a carriage return C<>; everything we print to that handle
47+
will get those characters at the end of the line, as shown.
48+
4449
=end pod
4550

4651
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6

doc/Type/IO.pod6

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ Defined as:
198198
multi sub put(Junction:D --> True)
199199
200200
Same as L«C<print>|/type/IO#sub_print», except it uses
201-
L«C<print-nl>|/routine/print-nl» (which printts a newline, by default) at the
202-
end. L<Junction> arguments
201+
L«C<print-nl>|/routine/print-nl» (which prints a L<newline|/language/newline>,
202+
by default) at the end. L<Junction> arguments
203203
L<autothread|/language/glossary#index-entry-Autothreading> and the order of
204204
printed strings is not guaranteed.
205205
@@ -214,7 +214,8 @@ Defined as:
214214
multi sub say(**@args --> True)
215215
216216
Prints the "gist" of given objects. Same as L«C<put>|/type/IO#sub_put», except
217-
uses L«C<.gist>|/routine/gist» method to obtain string representation of the object.
217+
uses L«C<.gist>|/routine/gist» method to obtain string representation of the
218+
object.
218219
219220
B<NOTE:> the L«C<.gist>|/routine/gist» method of some objects, such as
220221
L<Lists|/type/List#method_gist>, returns only B<partial> information about the

doc/Type/IO/Handle.pod6

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
class IO::Handle { }
88
99
10-
Instances of C<IO::Handle> encapsulate an I<handle> to manipulate input/output resources.
11-
Usually there is no need to create directly an C<IO::Handle> instance, since it will be done
12-
by other roles and methods. For instance, an L<IO::Path> object provides
13-
an L<open> method that returns an C<IO::Handle>:
10+
Instances of C<IO::Handle> encapsulate an I<handle> to manipulate input/output
11+
resources. Usually there is no need to create directly an C<IO::Handle>
12+
instance, since it will be done by other roles and methods. For instance, an
13+
L<IO::Path> object provides an L<open> method that returns an C<IO::Handle>:
1414
1515
my $fh = '/tmp/log.txt'.IO.open;
1616
say $fh.^name; # OUTPUT: IO::Handle
@@ -489,7 +489,9 @@ Defined as:
489489
490490
method print-nl(IO::Handle:D: --> True)
491491
492-
Writes the value of C<$.nl-out> attribute into the handle.
492+
Writes the value of C<$.nl-out> attribute into the handle. This attribute, by
493+
default, is C<>, but see the L<page on newline|/language/newline> for the rules
494+
it follows in different platforms and environments.
493495
494496
Attempting to call this method when the handle is
495497
L<in binary mode|/type/IO::Handle#method_encoding> will result in
@@ -508,9 +510,9 @@ Defined as:
508510
multi method printf(IO::Handle:D: Cool $format, *@args)
509511
510512
Formats a string based on the given format and arguments and C<.print>s the
511-
result into the filehandle.
512-
See L<sub sprintf|https://docs.perl6.org/type/Str#sub_sprintf> for details
513-
on acceptable format directives.
513+
result into the filehandle. See
514+
L<sub sprintf|https://docs.perl6.org/type/Str#sub_sprintf> for details on
515+
acceptable format directives.
514516
515517
Attempting to call this method when the handle is
516518
L<in binary mode|/type/IO::Handle#method_encoding> will result in

0 commit comments

Comments
 (0)