name
ErrorsCollection

name

Synthesised documentation from type/X/Bind/NativeType type/Routine type/ForeignCode type/X/Dynamic/NotFound type/Metamodel/Naming type/Scalar type/Label type/Encoding type/X/Attribute/Package type/Encoding/Registry type/Thread type/Systemic type/Variable type/Pod/Block/Named type/X/Attribute/Required type/X/Signature/NameClash type/X/IO/Symlink type/Parameter type/X/Attribute/NoPackage type/X/IO/Link type/Metamodel/DefiniteHOW type/Attribute

From type/X/Bind/NativeType

See Original text in context

method name(--> Str:D)

Returns the name of the variable.

From type/Routine

See Original text in context

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

Returns the name of the sub or method.

From type/ForeignCode

See Original text in context

method name()

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

From type/X/Dynamic/NotFound

See Original text in context

method name(--> Str:D)

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

From type/Metamodel/Naming

See Original text in context

method name($type)

Returns the name of the metaobject, if any.

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

From type/Scalar

See Original text in context

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

Returns the name associated with the container.

Example:

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

From type/Label

See Original text in context

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

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

From type/Encoding

See Original text in context

method name(--> Str)

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

From type/X/Attribute/Package

See Original text in context

method name(--> Str:D)

Returns the name of the attribute that triggered this error.

From type/Encoding/Registry

See Original text in context

method register(Encoding $enc --> Nil)

Register a new Encoding.

From type/Thread

See Original text in context

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␤»

From type/Systemic

See Original text in context

Instance method returning the name of the object.

From type/Variable

See Original text in context

method name(Variable:D: str)

Returns the name of the variable, including the sigil.

From type/Pod/Block/Named

See Original text in context

method name(--> Str:D)

Returns the name of the block.

From type/X/Attribute/Required

See Original text in context

method name(--> Str:D)

Returns the name of the attribute.

From type/X/Signature/NameClash

See Original text in context

method name(--> Str:D)

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

From type/X/IO/Symlink

See Original text in context

Returns the path that symlink failed to create.

From type/Parameter

See Original text in context

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 $xBool);
say $sig.params[0].name;                 # OUTPUT: «$x␤» 
say $sig.params[1].name;                 # OUTPUT: «␤» 

From type/X/Attribute/NoPackage

See Original text in context

method name(--> Str:D)

Returns the name of the attribute

From type/X/IO/Link

See Original text in context

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

From type/Metamodel/DefiniteHOW

See Original text in context

method name($definite_type)

Returns the name of a definite type.

From type/Attribute

See Original text in context

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␤»