Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add helper sub NOT_ALL_DEFINED_TYPE
  • Loading branch information
lizmat committed Dec 21, 2014
1 parent 4fa65d4 commit 70cf4f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/control.pm
Expand Up @@ -300,4 +300,12 @@ sub EXHAUST(|) {
X::ControlFlow::Return.new.throw();
}

# True if given array does not just contain defined objects of given type
sub NOT_ALL_DEFINED_TYPE(\values,\type) {
for values {
return True unless nqp::defined($_) && nqp::istype($_,type);
}
False;
}

# vim: ft=perl6 expandtab sw=4

0 comments on commit 70cf4f5

Please sign in to comment.