Merge pull request #241 from bjorn/sequence_each

Added Sequence.each
This commit is contained in:
Bob Nystrom
2015-04-01 07:10:21 -07:00
8 changed files with 29 additions and 3 deletions
+3
View File
@@ -0,0 +1,3 @@
var words = ""
["One", "Two", "Three"].each {|word| words = words + word }
IO.print(words) // expect: OneTwoThree
+3
View File
@@ -0,0 +1,3 @@
var i = 0
[].each {|item| i = i + 1 }
IO.print(i) // expect: 0
@@ -0,0 +1 @@
[1, 2, 3].each("string") // expect runtime error: String does not implement 'call(_)'.