Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add .WHO, .HOW and a way to work around reserved method names
  • Loading branch information
gfldex committed Jun 29, 2016
1 parent 71b32c5 commit c4dbd5d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doc/Language/typesystem.pod
Expand Up @@ -21,14 +21,16 @@ TODO
=head4 Reserved Method Names
Some build in introspection methods are actually special syntax provided by the
compiler, namely C<WHAT> and C<VAR>. Declaring methods with those names will
silently fail.
compiler, namely C<WHAT>, C<WHO>, C<HOW> and C<VAR>. Declaring methods with
those names will silently fail. A dynamic call will work, what allows to call
methods from foreign objects.
class A {
method WHAT { "ain't gonna happen" }
};
say A.new.WHAT; # OUTPUT«(A)␤»
say A.new."WHAT"() # OUTPUT«ain't gonna happen␤»
=head4 Setting Attributes with Namesake Variables and Methods
Expand Down

0 comments on commit c4dbd5d

Please sign in to comment.