Permalink
Browse files

Implement Promise.Bool.

  • Loading branch information...
1 parent b83de34 commit c1064c7558ad2d91fdccde59056ecd7985f57c5c @jnthn jnthn committed Oct 31, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/vm/jvm/core/Threading.pm
@@ -337,6 +337,10 @@ my class Promise {
so $!status == any(Broken, Kept)
}
+ multi method Bool(Promise:D:) {
+ self.has_result
+ }
+
method cause(Promise:D:) {
if $!status == Broken {
$!result

0 comments on commit c1064c7

Please sign in to comment.