When you first look at this, you may think that a string with a dollar such as $!signature or $!count or $!reified is a fancy representation of some internal attribute, and the non-alphabetical characters are used to prevent name clashes.

In fact, this is nothing more than an attribute of the class. A random example from src/core/Any-iterable-methods.pm:

my class IterateMoreWithPhasers does SlippyIterator {
has &!block;
has $!source;
has $!count;
has $!label;
has $!value-buffer;
has $!did-init;
has $!did-iterate;
has $!NEXT;
has $!CAN_FIRE_PHASERS;

The parameters of the nqp::getattr method are: an object, its class, and the name of the attribute.

The class A has one private attribute $!attr, which is set with a manual setter method set_attr.

After the new object is created, the attribute is set to some text value. Then, we use nqp::getattr to read the value from the attribute. Notice that the name of the attributed is passed as a string including the dollar and the exclamation mark characters.

The setter method in this example was needed because you cannot access a private attribute from outside. This is not the case for public attributes, which, in fact, are private attributes, for which Perl 6 creates getter and setter automatically. Here is an updated version of the same program, that employs a public attribute and still uses nqp::getattr: