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
@@ -51,6 +51,21 @@ static const char* libSource =
" result = result + \"]\"\n"
" return result\n"
" }\n"
"\n"
" + that {\n"
" var newList = []\n"
" if (this.count > 0) {\n"
" for (element in this) {\n"
" newList.add(element)\n"
" }\n"
" }\n"
" if (that is Range || that.count > 0) {\n"
" for (element in that) {\n"
" newList.add(element)\n"
" }\n"
" }\n"
" return newList\n"
" }\n"
"}\n";
// Validates that the given argument in [args] is a Num. Returns true if it is.