Add func:append & fixed serious bugs

This commit is contained in:
Valk Richard Li
2019-11-23 13:28:28 +08:00
committed by GitHub
parent b4468c6cc1
commit 000402a56d
4 changed files with 128 additions and 23 deletions
+3 -3
View File
@@ -1,12 +1,12 @@
# this file includes functions:
# append
# subvec
var append(vector,elements...)
var append=func(vector,elements...)
{
return __call_special_inline_function(vector,elements);
};
var subvec(vector,begin,length)
var subvec=func(vector,begin,length)
{
var new_vector=[];
for(var i=begin;i<begin+length;i+=1)
@@ -16,7 +16,7 @@ var subvec(vector,begin,length)
return new_vector;
};
var int(value)
var int=func(value)
{
return __call_Cpp_int(value);
};