diff options
author | David Walter Seikel | 2014-05-14 15:54:44 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-14 15:54:44 +1000 |
commit | 859839dd9a93af045f95189c039b17191ab9f988 (patch) | |
tree | aa428e470606b2266add9bd2223e1b06b83fa3f2 /lib | |
parent | Comment out some excess compiler warnings. (diff) | |
download | SledjHamr-859839dd9a93af045f95189c039b17191ab9f988.zip SledjHamr-859839dd9a93af045f95189c039b17191ab9f988.tar.gz SledjHamr-859839dd9a93af045f95189c039b17191ab9f988.tar.bz2 SledjHamr-859839dd9a93af045f95189c039b17191ab9f988.tar.xz |
Get list appending and adding to work.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/LSL.lua | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/LSL.lua b/lib/LSL.lua index 695c05d..092c3d9 100644 --- a/lib/LSL.lua +++ b/lib/LSL.lua | |||
@@ -871,5 +871,46 @@ function LSL.gimmeLSL() | |||
871 | end | 871 | end |
872 | end | 872 | end |
873 | 873 | ||
874 | -- Misc support functions. | ||
875 | |||
876 | function LSL.listAddList(a, b) | ||
877 | local i = 1 | ||
878 | local result = {} | ||
879 | |||
880 | for j, v in ipairs(a) do | ||
881 | i = i + 1 | ||
882 | table.insert(result, i, v) | ||
883 | end | ||
884 | |||
885 | for j, v in ipairs(b) do | ||
886 | i = i + 1 | ||
887 | table.insert(result, i, v) | ||
888 | end | ||
889 | |||
890 | return result; | ||
891 | end | ||
892 | |||
893 | function LSL.listAdd(a, b) | ||
894 | local i = 1 | ||
895 | local result = {} | ||
896 | |||
897 | for j, v in ipairs(a) do | ||
898 | i = i + 1 | ||
899 | table.insert(result, i, v) | ||
900 | end | ||
901 | |||
902 | table.insert(result, i, b) | ||
903 | |||
904 | return result; | ||
905 | end | ||
906 | |||
907 | function LSL.listConcat(a, b) | ||
908 | local i = table.maxn(a) | ||
909 | local result = a | ||
910 | |||
911 | table.insert(result, i + 1, b) | ||
912 | |||
913 | return result; | ||
914 | end | ||
874 | 915 | ||
875 | return LSL; | 916 | return LSL; |