|
@@ -75,3 +75,37 @@ Element function input_timeout(timeout : Float):
|
|
|
sleep(0.01)
|
|
|
|
|
|
return read_root()!
|
|
|
+
|
|
|
+Element function list_reverse(lst : Element):
|
|
|
+ Element result
|
|
|
+ result = create_node()
|
|
|
+
|
|
|
+ Integer i
|
|
|
+ i = list_len(lst)
|
|
|
+ while (i > 0):
|
|
|
+ list_append(result, list_read(lst, i))
|
|
|
+ i = i - 1
|
|
|
+
|
|
|
+ return result!
|
|
|
+
|
|
|
+Element function list_splice(lst : Element, start : Integer, end : Integer):
|
|
|
+ Element result
|
|
|
+ result = create_node()
|
|
|
+
|
|
|
+ Integer i
|
|
|
+ i = start
|
|
|
+ while (i <= end):
|
|
|
+ list_append(result, list_read(lst, i))
|
|
|
+ i = i + 1
|
|
|
+
|
|
|
+ return result!
|
|
|
+
|
|
|
+Element function list_extend(lst : Element, ext : Element):
|
|
|
+ Integer i
|
|
|
+ i = 0
|
|
|
+
|
|
|
+ while (i < list_len(ext)):
|
|
|
+ list_append(lst, list_read(ext, i))
|
|
|
+ i = i + 1
|
|
|
+
|
|
|
+ return lst!
|