The name routine

Combined from primary sources listed below.

In class X::Bind::NativeType ( Type/X/Bind/NativeType )§

See primary docmentation in context for method name.

method name§

method name(--> Str:D)

Returns the name of the variable.

In class Thread ( Type/Thread )§

See primary docmentation in context for method name.

method name§

method name(Thread:D: --> Str:D)

Returns the user defined string, which can optionally be set during object creation in order to identify the Thread, or '<anon>' if no such string was specified.

my $t1 = Thread.new(code => { for 1..5 -> $v { say $v }});
my $t2 = Thread.new(code => { for 1..5 -> $v { say $v }}, name => 'my thread');

say $t1.name;                 # OUTPUT: «<anon>␤»
say $t2.name;                 # OUTPUT: «my thread␤»

In class X::IO::Link ( Type/X/IO/Link )§

See primary docmentation in context for method name.

method name§

Returns the name of the link that could not be created.

In class X::Attribute::NoPackage ( Type/X/Attribute/NoPackage )§

See primary docmentation in context for method name.

method name§

method name(--> Str:D)

Returns the name of the attribute

In class Parameter ( Type/Parameter )§

See primary docmentation in context for method name.

method name§

method name(Parameter:D: --> Str:D)

Returns the parameter name, which includes all sigils and twigils. This name is used internally when applied to code, or in a declaration to determine the declared the name. This name is not necessarily usable by a caller – if it is, it will also appear as an alias. Often, the name will be chosen descriptively as a form of self-documentation.

If the parameter is anonymous, an empty string will be returned.

Note: Before Rakudo version 2020.08 the return value for an anonymous parameter was Nil.

my Signature $sig = :(Str $x, Bool);
say $sig.params[0].name;                 # OUTPUT: «$x␤»
say $sig.params[1].name;                 # OUTPUT: «␤»

In class Pod::Block::Named ( Type/Pod/Block/Named )§

See primary docmentation in context for method name.

method name§

method name(--> Str:D)

Returns the name of the block.

In role Metamodel::Naming ( Type/Metamodel/Naming )§

See primary docmentation in context for method name.

method name§

method name($type)

Returns the name of the metaobject, if any.

say 42.^name;       # OUTPUT: «Int␤»

In class Scalar ( Type/Scalar )§

See primary docmentation in context for method name.

method name§

method name(Scalar:D: --> Str)

Returns the name associated with the container.

Example:

my $x = 42;
say $x.VAR.name;                # OUTPUT: «$x␤»

In class ForeignCode ( Type/ForeignCode )§

See primary docmentation in context for method name.

method name§

method name()

Returns the name of the enclosed code, or <anon> if it has not received any.

In role Systemic ( Type/Systemic )§

See primary docmentation in context for method name.

method name§

Instance method returning the name of the object.

In class Attribute ( Type/Attribute )§

See primary docmentation in context for method name.

method name§

method name(Attribute:D: --> Str:D)

Returns the name of the attribute. Note that this is always the private name, so if an attribute is declared as has $.a, the name returned is $!a.

class Foo {
    has @!bar;
}
my $a = Foo.^attributes(:local)[0];
say $a.name;            # OUTPUT: «@!bar␤»

In class X::Attribute::Required ( Type/X/Attribute/Required )§

See primary docmentation in context for method name.

method name§

method name(--> Str:D)

Returns the name of the attribute.

In class Metamodel::DefiniteHOW ( Type/Metamodel/DefiniteHOW )§

See primary docmentation in context for method name.

method name§

method name($definite_type)

Returns the name of a definite type.

In class X::IO::Symlink ( Type/X/IO/Symlink )§

See primary docmentation in context for method name.

method name§

Returns the path that symlink failed to create.

In role Encoding ( Type/Encoding )§

See primary docmentation in context for method name.

method name§

method name(--> Str)

Abstract method that would return the primary name of the encoding.

In class X::Attribute::Package ( Type/X/Attribute/Package )§

See primary docmentation in context for method name.

method name§

method name(--> Str:D)

Returns the name of the attribute that triggered this error.

In class Encoding::Registry ( Type/Encoding/Registry )§

See primary docmentation in context for method name.

method name§

method register(Encoding $enc --> Nil)

Register a new Encoding.

In class Variable ( Type/Variable )§

See primary docmentation in context for method name.

method name§

method name(Variable:D: str)

Returns the name of the variable, including the sigil.

In class Routine ( Type/Routine )§

See primary docmentation in context for method name.

method name§

method name(Routine:D: --> Str:D)

Returns the name of the sub or method.

In class X::Signature::NameClash ( Type/X/Signature/NameClash )§

See primary docmentation in context for method name.

method name§

method name(--> Str:D)

Returns the name that was used for more than one parameter.

In class X::Dynamic::NotFound ( Type/X/Dynamic/NotFound )§

See primary docmentation in context for method name.

method name§

method name(--> Str:D)

Returns the name of the variable that has not been found.

In class Label ( Type/Label )§

See primary docmentation in context for method name.

method name§

Not terribly useful, returns the name of the defined label:

A: while True {
  say A.name# OUTPUT: «A␤»
  last A;
}