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
@@ -0,0 +1,15 @@
var a = [1, 2, 3]
var b = [4, 5, 6]
var c = a + b
var d = a + (4..6)
var e = a + []
var f = [] + a
var g = [] + []
IO.print(a) // expect: [1, 2, 3]
IO.print(b) // expect: [4, 5, 6]
IO.print(c) // expect: [1, 2, 3, 4, 5, 6]
IO.print(d) // expect: [1, 2, 3, 4, 5, 6]
IO.print(e) // expect: [1, 2, 3]
IO.print(f) // expect: [1, 2, 3]
IO.print(g) // expect: []