Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add Bool method to Capture
Right now, defined captures evaluate to `True`, but empty captures should probably be `False`.
  • Loading branch information
gerdr committed Mar 7, 2013
1 parent 11157e9 commit 9f873d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/Capture.pm
Expand Up @@ -69,6 +69,10 @@ my class Capture {
nqp::p6box_s(nqp::join(' ', $str))
}

multi method Bool(Capture:D:) {
$!list || $!hash ?? True !! False
}

method Capture(Capture:D:) {
self
}
Expand Down

0 comments on commit 9f873d8

Please sign in to comment.