Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- General:
- .Str, .gist, .raku
- Reserved method names (classes can't define them themselves), cf. https://docs.raku.org/language/typesystem#Reserved_method_names :
- WHAT -
- WHO -
- HOW - ~manner of implementation
- VAR
- Methods of the class Mu (classes can re-define them):
- WHY - Documentation
- WHERE - Memory address, probably
- WHICH -
- VAR
- .VAR.WHAT or .VAR.^name: Type of the container: Scalar, Array, etc.
- .^name
- .^type (sometimes)
- .^attributes
- .^parents
- .^methods
- .^mro ("method resolution order")
- .^roles
- .keys # esp. for modules: Foo::Bar::.keys
- For classes and their instances:
- Classes: .^parents .^parents(:all) .^roles .^methods .^mro .^attributes .^api
- Instances: .^parents .^parents(:all) .^roles .^methods .^mro .^attributes
- Methods: [see Routines. Furthermore, specifically for methods: ...]
- Routines: .name .signature .candidates
- say (
- .name
- .package
- .has_accessor
- .^type
- ) for C.^attributes; # or C.new.^attributes
- To test if a given type object is a class:
- class C {}; say C.HOW ~~ Metamodel::ClassHOW;
- # https://docs.raku.org/language/typesystem#Type_system
- class C:ver<4.2.3>:auth<github:jane>:api<1> {}
- say C.^ver; # OUTPUT: «v4.2.3»
- say C.^ver.parts; # OUTPUT: «(4 2 3)»
- say C.^auth; # OUTPUT: «github:jane»
- say C.^api; # OUTPUT: «1»
- Seq (Lists, Arrays...)
- Hash
- <What I've skipped so far: >
- enum (/language/typesystem)
Advertisement
Add Comment
Please, Sign In to add comment