<commit_before>
=encoding utf8

=head1 TITLE

DRAFT: Synopsis 32: Setting Library - IO

=head1 AUTHORS

    The authors of the related Perl 5 docs
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>

=head1 VERSION

    Created: 19 Feb 2009 extracted from S29-functions.pod; added stuff from S16-IO later

    Last Modified: 20 Apr 2009
    Version: 6

The document is a draft.

If you read the HTML version, it is generated from the pod in the pugs
repository under /docs/Perl6/Spec/S32-setting-library/IO.pod so edit it there in
the SVN repository if you would like to make changes.

=head2 IO

[Note: if a method declaration indicates a method name qualified by
type, it should be taken as shorthand to say which role or class the
method is actually declared in.]

=over 4

=item open
X<open>

    multi open (Str $name,
        Bool :$rw = False,
        Bool :$bin = False,
        Str  :$enc = "Unicode",
        Any  :$nl = "\n",
        Bool :$chomp = True,
        ...
        --> IO
    ) is export

A convenience method/function that hides most of the OO complexity.
It will only open normal files.  Text is the default.  Note that
the "Unicode" encoding implies figuring out which actual UTF is
in use, either from a BOM or other heuristics.  If heuristics are
inconclusive, UTF-8 will be assumed.  (No 8-bit encoding will ever
be picked implicitly.)  A file opened with C<:bin> may still be
processed line-by-line, but IO will be in terms of C<Buf> rather
than C<Str> types.

=item getc
X<getc>

    method getc (Int $chars = 1 --> Char)

See below for details.

=item print
X<print>

    method print (*@LIST --> Bool)
    multi print (*@LIST --> Bool)
    method Str::print (IO $io --> Bool)
    method Array::print (IO $io --> Bool)
    method Hash::print (IO $io --> Bool)

See below for details.

=item say
X<say>

    method say (*@LIST --> Bool)
    multi say (*@LIST --> Bool)
    method Str::say (IO $io --> Bool)<commit_msg>TODO: open :r, :w, :a<commit_after>
=encoding utf8

=head1 TITLE

DRAFT: Synopsis 32: Setting Library - IO

=head1 AUTHORS

    The authors of the related Perl 5 docs
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>
    <NAME> <<EMAIL>>

=head1 VERSION

    Created: 19 Feb 2009 extracted from S29-functions.pod; added stuff from S16-IO later

    Last Modified: 20 Apr 2009
    Version: 6

The document is a draft.

If you read the HTML version, it is generated from the pod in the pugs
repository under /docs/Perl6/Spec/S32-setting-library/IO.pod so edit it there in
the SVN repository if you would like to make changes.

=head2 IO

[Note: if a method declaration indicates a method name qualified by
type, it should be taken as shorthand to say which role or class the
method is actually declared in.]

=over 4

=item open
X<open>

    multi open (Str $name,
        Bool :$rw = False,
        Bool :$bin = False,
        Str  :$enc = "Unicode",
        Any  :$nl = "\n",
        Bool :$chomp = True,
        ...
        --> IO
    ) is export

A convenience method/function that hides most of the OO complexity.
It will only open normal files.  Text is the default.  Note that
the "Unicode" encoding implies figuring out which actual UTF is
in use, either from a BOM or other heuristics.  If heuristics are
inconclusive, UTF-8 will be assumed.  (No 8-bit encoding will ever
be picked implicitly.)  A file opened with C<:bin> may still be
processed line-by-line, but IO will be in terms of C<Buf> rather
than C<Str> types.

TODO: document read/write/append modes (:r, :w, :a)

=item getc
X<getc>

    method getc (Int $chars = 1 --> Char)

See below for details.

=item print
X<print>

    method print (*@LIST --> Bool)
    multi print (*@LIST --> Bool)
    method Str::print (IO $io --> Bool)
    method Array::print (IO $io --> Bool)
    method Hash::print (IO $io --> Bool)

See below for details.

=item say
X<say>

    method say (*@LIST --> Bool)
    multi say (*@LIST --> Bool)
    method Str::say (IO $io --> Bool)
{'fraction_non_alphanumeric': 0.11302908489004493, 'fraction_numerical': 0.015133601324190116, 'mean_word_length': 2.807380738073807, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7359949', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1353, 'n_words': 600}