From b56590ddc986ab07ce105fef6c5ab8d48c8599cd Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 27 Mar 2022 11:42:19 -0700 Subject: 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. --- toot-toot.tlv | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'toot-toot.tlv') diff --git a/toot-toot.tlv b/toot-toot.tlv index bb5ea56..0e524db 100644 --- a/toot-toot.tlv +++ b/toot-toot.tlv @@ -148,6 +148,29 @@ > end > 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 @@ -191,29 +214,6 @@ > end > 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) -- cgit 1.4.1-2-gfad0