doc updates

This commit is contained in:
vaclavt 2022-02-01 23:47:05 +01:00
parent d1bbe16459
commit 5d97c1df86
4 changed files with 15 additions and 11 deletions

View File

@ -71,7 +71,7 @@ utils/local_install.sh
### TODO ### TODO
- add test for >>> (range 1.5 (inc 5.5)) => (1.500000 2.500000 3.500000 4.500000 5.500000) - add test for >>> (range 1.5 (inc 5.5)) => (1.500000 2.500000 3.500000 4.500000 5.500000)
- better formating of help - ml_utils.cpp add all commands into const std::vector<std::string> commands
- unify -f and -run options - unify -f and -run options
- add debug support, at least call stack - add debug support, at least call stack
- multiline editing (see kilocpp editor) - multiline editing (see kilocpp editor)

View File

@ -1,11 +1,15 @@
(defn concat-lists (seq1 seq2) (doc::man "string-regex-list")
(do (def l seq1) (doc::man "string-split")
(dotimes i (len seq2) (doc::man "string-trim")
(set! l (push l (index seq2 i))))
))
(print (concat-lists '(1 2 3) '(4 5 6))) ;; (defn concat-lists (seq1 seq2)
;; (do (def l seq1)
;; (dotimes i (len seq2)
;; (set! l (push l (index seq2 i))))
;; ))
;; (print (concat-lists '(1 2 3) '(4 5 6)))
;; (1 2 3 4 5 6) ;; (1 2 3 4 5 6)
; pridat example ; pridat example

View File

@ -120,7 +120,7 @@
|`(string-pad str len char rpad_lpad)`|Pad string from start or to end with char to length||String manipulation| |`(string-pad str len char rpad_lpad)`|Pad string from start or to end with char to length||String manipulation|
|`(string-lpad str len char)`|Pad string from start with char to length len|`>>> (string-lpad "0" 10 "x") => "xxxxxxxxx0"`|String manipulation| |`(string-lpad str len char)`|Pad string from start with char to length len|`>>> (string-lpad "0" 10 "x") => "xxxxxxxxx0"`|String manipulation|
|`(string-rpad str len char)`|Pad string from righ with char to length len|`>>> (string-rpad "0" 10 "x") => "0xxxxxxxxx"`|String manipulation| |`(string-rpad str len char)`|Pad string from righ with char to length len|`>>> (string-rpad "0" 10 "x") => "0xxxxxxxxx"`|String manipulation|
|`(string-split str separator)`|Splits string into list by regexp|`>>> (string-split "split me by space" "\s+") => ("split" "me" "by" "space")`| |`(string-split str separator)`|Splits string into list by regexp|`>>> (string-split "split me by space" "\s+") => ("split" "me" "by" "space")`|String manipulation|
|`(string-rltrim str len RKRRKR)`|Removes " \n\r\t" from the begininfg or end or both ends of str||Regex| |`(string-rltrim str len RKRRKR)`|Removes " \n\r\t" from the begininfg or end or both ends of str||Regex|
|`(string-ltrim str)`|Removes " \n\r\t" from the begininfg of str||String manipulation| |`(string-ltrim str)`|Removes " \n\r\t" from the begininfg of str||String manipulation|
|`(string-rtrim str)`|Removes " \n\r\t" from the end of str||String manipulation| |`(string-rtrim str)`|Removes " \n\r\t" from the end of str||String manipulation|

View File

@ -28,9 +28,9 @@
(defn doc::print (entry) (defn doc::print (entry)
(do (print (term-green (doc::strip-backticks (second entry))) "-" (third entry)) (do (print (term-green (doc::strip-backticks (second entry))) "-" (third entry))
; (print (last entry) "\n") ; doc section (if (> (string-len (fourth entry)) 2) ; example
(if (> (string-len (fourth entry)) 2) (for example (string-regex-list (fourth entry) "(`.*?`)" "token")
(do (def examp (doc::strip-backticks (fourth entry))) (def examp (doc::strip-backticks (first example)))
(def pos (string-find examp "=>" 0)) (def pos (string-find examp "=>" 0))
(if (and pos (> pos 0)) (if (and pos (> pos 0))
(print (term-magenta (print (term-magenta