Add count to Sequence.

This commit is contained in:
Bob Nystrom
2015-03-06 07:01:02 -08:00
parent d722adddff
commit d35e3c917c
3 changed files with 27 additions and 0 deletions
+8
View File
@@ -1,4 +1,12 @@
class Sequence {
count {
var result = 0
for (element in this) {
result = result + 1
}
return result
}
map(f) {
var result = new List
for (element in this) {