Third try. ;) Concat operator, tests. Now [1,2,3] + (4..6) works! Inlined helper functions to keep core lib small.

This commit is contained in:
Kyle Marek-Spartz
2014-02-14 11:16:57 -06:00
parent edd360a934
commit e519ecbc49
3 changed files with 45 additions and 0 deletions
+15
View File
@@ -8,4 +8,19 @@ class List {
result = result + "]"
return result
}
+ that {
var newList = []
if (this.count > 0) {
for (element in this) {
newList.add(element)
}
}
if (that is Range || that.count > 0) {
for (element in that) {
newList.add(element)
}
}
return newList
}
}