class RakuAST::Name::Part::Expression { }

The RakuAST::Name::Part::Expression class represents an expressioni as part of a RakuAST::Name object.

Object introspection§

RakuAST::Name::Part::Expression object is typically created when parsing Raku Programming Language code. So most developers will only need to know how to introspect the objects created.

name§

say $part.name;  # foo

Returns the name of this part as a Str.

is-empty§

say $part.is-empty;  # True or False

Returns whether the .name of this RakuAST::Name::Part::Expression object is the empty string.

is-pseudo-package§

say $part.is-pseudo-package;  # True or False

Returns whether this part could be considered a pseudo-package name. The following names would be considered pseudo-packages:

  • CALLER

  • CALLERS

  • CLIENT

  • COMPILING

  • CORE

  • DYNAMIC

  • LEXICAL

  • MY

  • OUR

  • OUTER

  • OUTERS

  • SETTING

  • UNIT

Object creation§

my $part = RakuAST::Name::Part::Expression.new($expression);

A RakuAST::Name::Part::Expression object is instantiated with the .new method. It takes a single argument: RakuAST::Expression compatible object to be used for that part.