diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-03-27 11:42:19 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-03-27 11:42:19 -0700 |
commit | b56590ddc986ab07ce105fef6c5ab8d48c8599cd (patch) | |
tree | 93bede7fc152acfd44821aa3a96e16bd4d145647 /graphviz.tlv | |
parent | 14446eefc41096096228bdc270dd2e3c74337507 (diff) | |
download | teliva-b56590ddc986ab07ce105fef6c5ab8d48c8599cd.tar.gz |
some more reorg of the standard library
Now life.tlv and gemini.tlv are also minimizing how much of the standard library they pull in, just to be easy to read.
Diffstat (limited to 'graphviz.tlv')
-rw-r--r-- | graphviz.tlv | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/graphviz.tlv b/graphviz.tlv index bed0808..9143d83 100644 --- a/graphviz.tlv +++ b/graphviz.tlv @@ -149,6 +149,29 @@ > return tostring(x) >end - __teliva_timestamp: original + find_index: + >function find_index(arr, x) + > for n, y in ipairs(arr) do + > if x == y then + > return n + > end + > end + >end +- __teliva_timestamp: original + trim: + >function trim(s) + > return s:gsub('^%s*', ''):gsub('%s*$', '') + >end +- __teliva_timestamp: original + split: + >function split(s, d) + > result = {} + > for match in (s..d):gmatch("(.-)"..d) do + > table.insert(result, match); + > end + > return result + >end +- __teliva_timestamp: original map: >-- only for arrays >function map(l, f) @@ -192,29 +215,6 @@ > return result >end - __teliva_timestamp: original - find_index: - >function find_index(arr, x) - > for n, y in ipairs(arr) do - > if x == y then - > return n - > end - > end - >end -- __teliva_timestamp: original - trim: - >function trim(s) - > return s:gsub('^%s*', ''):gsub('%s*$', '') - >end -- __teliva_timestamp: original - split: - >function split(s, d) - > result = {} - > for match in (s..d):gmatch("(.-)"..d) do - > table.insert(result, match); - > end - > return result - >end -- __teliva_timestamp: original sort_letters: >function sort_letters(s) > tmp = {} |