<commit_before>=begin pod

=TITLE Code

    class Code is Any does Callable { ... }

C<Code> is the ultimate base class of all code objects in Perl 6. It
exposes functionality that all code objects have. While thunks are
directly of type C<Code>, most code objects (such as those resulting
from blocks, subroutines or methods) will be of some subclass of C<Code>.


=head1 Methods

=head2 ACCEPTS

    multi method ACCEPTS(Code:D: Mu $topic)

Usually calls the code object and passes C<$topic> as an argument.
However, when called on a code object that takes no arguments, the code
object is invoked with no arguments and C<$topic> is dropped. The
result of the call is returned.

=head2 arity

    method arity(Code:D:) returns Int:D

Returns the minimum number of positional arguments that must be passed
in order to call the code object. Any optional or slurpy parameters in the
code object's C<Signature> do not contribute, nor do named parameters.

    sub argless() { }
    sub args($a, $b?) { }
    sub slurpy($a, $b, *@c) { }
    say &argless.arity;             # 0
    say &args.arity;                # 1
    say &slurpy.arity;              # 2

=head2 count

    method count(Code:D:) returns Real:D

Returns the maximum number of positional arguments that may be passed
when calling the code object. For code objects that can accept any
number of positional arguments (that is, they have a slurpy parameter),
C<count> will return C<Inf>. Named parameters do not contribute.

    sub argless() { }
    sub args($a, $b?) { }
    sub slurpy($a, $b, *@c) { }
    say &argless.count;             # 0
    say &args.count;                # 2
    say &slurpy.count;              # Inf

=head2 signature

    multi method signature(Code:D:) returns Signature:D

Returns the C<Signature> object for this code object, which describes
its parameters.

=head2 Str

    multi method Str(Code:D:) returns Str:D

Returns the name of the code object.

    sub marine() { }
    say ~&marine.name;   # marine

=end pod<commit_msg>[Code]:  Update .Str example to actually use Code.Str :-).<commit_after>=begin pod

=TITLE Code

    class Code is Any does Callable { ... }

C<Code> is the ultimate base class of all code objects in Perl 6. It
exposes functionality that all code objects have. While thunks are
directly of type C<Code>, most code objects (such as those resulting
from blocks, subroutines or methods) will be of some subclass of C<Code>.


=head1 Methods

=head2 ACCEPTS

    multi method ACCEPTS(Code:D: Mu $topic)

Usually calls the code object and passes C<$topic> as an argument.
However, when called on a code object that takes no arguments, the code
object is invoked with no arguments and C<$topic> is dropped. The
result of the call is returned.

=head2 arity

    method arity(Code:D:) returns Int:D

Returns the minimum number of positional arguments that must be passed
in order to call the code object. Any optional or slurpy parameters in the
code object's C<Signature> do not contribute, nor do named parameters.

    sub argless() { }
    sub args($a, $b?) { }
    sub slurpy($a, $b, *@c) { }
    say &argless.arity;             # 0
    say &args.arity;                # 1
    say &slurpy.arity;              # 2

=head2 count

    method count(Code:D:) returns Real:D

Returns the maximum number of positional arguments that may be passed
when calling the code object. For code objects that can accept any
number of positional arguments (that is, they have a slurpy parameter),
C<count> will return C<Inf>. Named parameters do not contribute.

    sub argless() { }
    sub args($a, $b?) { }
    sub slurpy($a, $b, *@c) { }
    say &argless.count;             # 0
    say &args.count;                # 2
    say &slurpy.count;              # Inf

=head2 signature

    multi method signature(Code:D:) returns Signature:D

Returns the C<Signature> object for this code object, which describes
its parameters.

=head2 Str

    multi method Str(Code:D:) returns Str:D

Returns the name of the code object.

    sub marine() { }
    say ~&marine;   # marine

=end pod
{'fraction_non_alphanumeric': 0.08276199804113614, 'fraction_numerical': 0.005876591576885406, 'mean_word_length': 2.9931573802541545, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '6557941', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1178, 'n_words': 553}