Make Sequence base class.
This lets us share functionality between List and Range (and other user-defined sequence types).
This commit is contained in:
+1
-3
@@ -1,5 +1,3 @@
|
||||
var a = [1, 2, 3]
|
||||
var inc = fn (x) { return x + 1 }
|
||||
var b = a.map(inc)
|
||||
|
||||
var b = a.map(fn (x) x + 1)
|
||||
IO.print(b) // expect: [2, 3, 4]
|
||||
|
||||
Reference in New Issue
Block a user