documentation improvements

This commit is contained in:
VaclavT 2021-04-12 22:43:51 +02:00
parent 288b75c1ad
commit 8e1b50b795
1 changed files with 16 additions and 16 deletions

View File

@ -68,47 +68,47 @@
|`(get-universal-time)`|Get current time as secs from epoch|| |`(get-universal-time)`|Get current time as secs from epoch||
|`(date-to-str date format)`|Converts date to formated string. Format is strftime format (https://www.tutorialspoint.com/c_standard_library/c_function_strftime.htm)|`>>> (date-to-str (get-universal-time) "%Y-%m-%d %H:%M:%S") |`(date-to-str date format)`|Converts date to formated string. Format is strftime format (https://www.tutorialspoint.com/c_standard_library/c_function_strftime.htm)|`>>> (date-to-str (get-universal-time) "%Y-%m-%d %H:%M:%S")
=> "2021-03-13 19:53:01"`| => "2021-03-13 19:53:01"`|
|`(str-to-date string format)`|Converst string to time of secs since epoch. |`>>> (str-to-date "2021-03-13 19:53:01" "%Y-%m-%d %H:%M:%S") |`(str-to-date string format)`|Converst string to time of secs since epoch. |`>>> (str-to-date "2021-03-13 19:53:01" "%Y-%m-%d %H:%M:%S") => 1615665181`|
=> 1615665181`| |`(date-add ..)`|Add number of units to date. A unit is one of 'year', 'month', 'day', 'hour', 'minute' or 'second'|`>>> (date-to-str (date-add (str-to-date "2021-03-13 19:53:01" "%Y-%m-%d %H:%M:%S") 10 "day") "%Y-%m-%d %H:%M:%S") => "2021-03-23 20:53:01"`|
|`(date-add ..)`|Add number of units to date. A unit is one of 'year', 'month', 'day', 'hour', 'minute' or 'second'|`>>> (date-to-str (date-add (str-to-date "2021-03-13 19:53:01" "%Y-%m-%d %H:%M:%S") 10 "day") "%Y-%m-%d %H:%M:%S")
=> "2021-03-23 20:53:01"`|
|`(debug ..)`||| |`(debug ..)`|||
|`(display ..)`||| |`(display ..)`|||
|`(string-replace source substr replacement)`|Replace a substring with a replacement string in a source string|`>>> (string-replace "abcdefg" "de" "DE") => "abcDEfg"`| |`(string-replace source substr replacement)`|Replace a substring with a replacement string in a source string|`>>> (string-replace "abcdefg" "de" "DE") => "abcDEfg"`|
|`(string-regex? where regex)`| Returns true if where contains regex|`>>> (string-regex? "aba123cdefg" "[0-9]+") => 1`| |`(string-regex? where regex)`| Returns true if where contains regex|`>>> (string-regex? "aba123cdefg" "[0-9]+") => 1`|
|`(string-pad str len char rpad_lpad)`||| |`(string-pad str len char rpad_lpad)`|||
|`(string-lpad str len char)`||| |`(string-lpad str len char)`|Pad string from start with char to length len|`>>> (string-lpad "0" 10 "x") => "xxxxxxxxx0"`|
|`(string-rpad str len char)`||| |`(string-rpad str len char)`|Pad string from righ with char to length len|`>>> (string-rpad "0" 10 "x") => "0xxxxxxxxx"`|
|`(string-split str separator)`||| |`(string-split str separator)`|||
`(string-rltrim str len RKRRKR)`| || `(string-rltrim str len RKRRKR)`| ||
`(string-ltrim str)`|Removes " \n\r\t" from the begininfg of str|| `(string-ltrim str)`|Removes " \n\r\t" from the begininfg of str||
`(string-rtrim str)`|Removes " \n\r\t" from the end of str|| `(string-rtrim str)`|Removes " \n\r\t" from the end of str||
`(string-trim str)`|Removes " \n\r\t" from the both strart and end of str|| `(string-trim str)`|Removes " \n\r\t" from the both strart and end of str||
`(string-case str RKRRKR)`||| `(string-case str RKRRKR)`|||
`(string-upcase str)`||| `(string-upcase str)`|Returns up cased string|`>>> (string-upcase "abcdefghchijklmn") => "ABCDEFGHCHIJKLMN"`|
`(string-downcase str)`||| `(string-downcase str)`|Returns down cased string |`>>> (string-downcase "ABCDefghchijklmn") => "abcdefghchijklmn"`|
`(string-join lst sep)`|Returns string created as elements of concatenation of lst elements separated by sep||
`(endl)`||| `(endl)`|||
|`(int value)`|Cast an item to an int|`>>> (int 3.41) => 3`| |`(int value)`|Cast an item to an int|`>>> (int 3.41) => 3`|
|`(float value)`|Cast item to a float|`>>> (int 3.41) => 3.14`| |`(float value)`|Cast item to a float|`>>> (int 3.41) => 3.14`|
|`(string value)`|Cast int or float item to a string|`>>> (string 3.14) => "3.14"`| |`(string value)`|Cast int or float item to a string|`>>> (string 3.14) => "3.14"`|
|`(eval ..)`||| |`(eval <exp>)`|Eval returns the value of the second evaluation|`>>> (eval '(+ 1 2)) => 3`|
|`(type ..)`||| |`(type e)`|Returns data type of e|`>>> (type (+ 1 2)) => "int"`|
|`(parse ..)`||| |`(parse ..)`|||
|`(make-list-of size value)`|Makes list with size elements of values|| |`(make-list-of size value)`|Makes list with size elements of values||
|`(make-list size)`|Makes list of nil values with size length|| |`(make-list size)`|Makes list of nil values with size length||
|`(empty-list? lst)`|Return true is lst is list with zero elements||
|`(memeber lst item)`|Returns 1 when item is inluded in lst otherwise 0|| |`(memeber lst item)`|Returns 1 when item is inluded in lst otherwise 0||
|`(uniq list)`||| |`(uniq list)`|Filter out any duplicates from list|`>>> (uniq '(1 2 2 3 4 5 2 2)) => (1 2 3 4 5)`|
|`(flatten list)`||| |`(flatten list)`||`>>> (flatten '(1 (2 2) 3)) => (1 2 2 3)`|
|`(quick-sort-by list cmp)`||| |`(quick-sort-by list cmp)`|||
|`(quick-sort list)`||| |`(quick-sort list)`|return sorted list|`>>> (quick-sort '(2 4 6 1 7 3 3 9 5)) => (1 2 3 3 4 5 6 7 9)`|
|`(not c)`|Logical NOT of c|| |`(not c)`|Logical NOT of c||
|`(new n)`|Negates number|| |`(new n)`|Negates number||
|`(is-pos? n)`|Returns true if n is positive number|| |`(is-pos? n)`|Returns true if n is positive number||
|`(is-neg? n)`|Returns true if n is negative number|| |`(is-neg? n)`|Returns true if n is negative number||
|`(dec n)`|Return n decremented by 1|| |`(dec n)`|Return n decremented by 1|`>>> (dec 5) => 4`|
|`(inc n)`|Return n incremented by 1|| |`(inc n)`|Return n incremented by 1|`>>> (inc 5) => 6`|
|`(sleep time)`|Pauses execution for time interval of seconds|| |`(sleep time)`|Pauses execution for time interval of seconds||
|`(get-env var)`|Return environment variable var|| |`(get-env var)`|Return environment variable var|`>>> (get-env "HOME") => "/Users/vaclavt"`|
|`(second l)`|Returns second element of list|| |`(second l)`|Returns second element of list||
|`(third l)`|Returns third element of list|| |`(third l)`|Returns third element of list||
|`(fourth l)`|Returns fourth element of list|| |`(fourth l)`|Returns fourth element of list||