Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my @package-ish = do given Metamodel {
- $_<
- PackageHOW
- ModuleHOW
- ClassHOW
- GrammarHOW
- CurriedRoleHOW
- ConcreteRoleHOW
- ParametricRoleHOW
- ParametricRoleGroupHOW
- >;
- }
- sub is-package($object) is export {
- !$object.defined && $object.HOW ~~ any @package-ish;
- }
- # These are package-like objects. Not sure if Nil should count or not.
- do .&is-package for class {}, package {}, role {}, IO, Int, GLOBAL, Proc, X, Nil;
- # These are not packages
- do .&is-package for "", 7, [], {}, /asdf/, &substr, :(Int, Str), \(1, 2, 3);
Add Comment
Please, Sign In to add comment