Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
show how to test for classness and enumness
  • Loading branch information
gfldex committed Aug 30, 2016
1 parent 71df199 commit 02f4ff8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions doc/Language/typesystem.pod6
Expand Up @@ -75,6 +75,17 @@ compiler will check at the end of the current scope if the type is defined.
TODO
=head3 Introspection
=head4 Metaclass
To test if a given type object is a class test the meta object method C<.HOW>
for L</type/Metamodel::ClassHOW>.
class C {};
say C.HOW ~~ Metamodel::ClassHOW;
# OUTPUT«True␤»
=head3 Attributes
=head4 Private Attributes
Expand Down Expand Up @@ -436,6 +447,17 @@ package, we can get a list of type objects for the keys.
enum E(<one two>); dd E::.values;
# OUTPUT«(E::two, E::one).Seq␤»
=head3 Introspection
=head4 Metaclass
To test if a given type object is an enum test the meta object method C<.HOW>
for L</type/Metamodel::EnumHOW>.
enum E(<a b c>);
say E.HOW ~~ Metamodel::EnumHOW;
# OUTPUT«True␤»
=head3 Methods
=head4 method enums
Expand Down

0 comments on commit 02f4ff8

Please sign in to comment.