Make Sequence base class.

This lets us share functionality between List and Range (and
other user-defined sequence types).
This commit is contained in:
Bob Nystrom
2014-02-16 09:20:31 -08:00
parent 4d8bf4bc8e
commit f8a9d7f321
8 changed files with 68 additions and 53 deletions
+3 -5
View File
@@ -1,8 +1,6 @@
var a = [1, 2, 3]
var moreThan1 = fn (x) { return x > 1 }
var moreThan10 = fn (x) { return x > 10 }
var b = a.where(moreThan1)
var c = a.where(moreThan10)
var b = a.where(fn (x) x > 1)
IO.print(b) // expect: [2, 3]
var c = a.where(fn (x) x > 10)
IO.print(c) // expect: []