Adds forall method on Sequences.

This commit is contained in:
Gavin Schulz
2015-01-13 23:47:01 -08:00
parent 73b041a78a
commit 7716ad6263
4 changed files with 27 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
var a = [1, 2, 3]
var b = a.forall {|x| x > 1 }
IO.print(b) // expect: false
var c = a.forall {|x| x.toString }
IO.print(c) // expect: false
var d = a.forall {|x| x > 0 }
IO.print(d) // expect: true