See Original text in context
The anon
declarator prevents a symbol from getting installed in the lexical scope, the method table and everywhere else.
For example, you can use it to declare subroutines which know their own name, but still aren't installed in a scope:
my =half => anon sub half() ,square => anon sub square() ,;say <square>.name; # squaresay <square>(8); # 64
Since it is a declarator, it can be applied anywhere anything is declared, for instance for classes or even sigilless variables.
say anon ; # OUTPUT: «(þ)»say anon sub þ ; # OUTPUT: «&þ»
Since these symbols are not installed in the scope, they can't be used by name. They are useful, however, if they need to be assigned to an external variable and they need to know their own name, but this can be retrieved using introspection.
my = anon class;say .new( :3bar).equal( .new( :3bar ) );# OUTPUT: «True»