From 8e1b50b79584cfcfa00f7fc7070b51f288d13cf0 Mon Sep 17 00:00:00 2001 From: VaclavT Date: Mon, 12 Apr 2021 22:43:51 +0200 Subject: [PATCH] documentation improvements --- doc/Doc.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/Doc.md b/doc/Doc.md index f1203e4..a407c7b 100644 --- a/doc/Doc.md +++ b/doc/Doc.md @@ -68,47 +68,47 @@ |`(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") => "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") - => 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"`| +|`(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`| +|`(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 ..)`||| |`(display ..)`||| |`(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-pad str len char rpad_lpad)`||| -|`(string-lpad str len char)`||| -|`(string-rpad 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)`|Pad string from righ with char to length len|`>>> (string-rpad "0" 10 "x") => "0xxxxxxxxx"`| |`(string-split str separator)`||| `(string-rltrim str len RKRRKR)`| || `(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-trim str)`|Removes " \n\r\t" from the both strart and end of str|| `(string-case str RKRRKR)`||| -`(string-upcase str)`||| -`(string-downcase str)`||| +`(string-upcase str)`|Returns up cased string|`>>> (string-upcase "abcdefghchijklmn") => "ABCDEFGHCHIJKLMN"`| +`(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)`||| |`(int value)`|Cast an item to an int|`>>> (int 3.41) => 3`| |`(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"`| -|`(eval ..)`||| -|`(type ..)`||| +|`(eval )`|Eval returns the value of the second evaluation|`>>> (eval '(+ 1 2)) => 3`| +|`(type e)`|Returns data type of e|`>>> (type (+ 1 2)) => "int"`| |`(parse ..)`||| |`(make-list-of size value)`|Makes list with size elements of values|| |`(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|| -|`(uniq list)`||| -|`(flatten 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 '(1 (2 2) 3)) => (1 2 2 3)`| |`(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|| |`(new n)`|Negates number|| |`(is-pos? n)`|Returns true if n is positive number|| |`(is-neg? n)`|Returns true if n is negative number|| -|`(dec n)`|Return n decremented by 1|| -|`(inc n)`|Return n incremented by 1|| +|`(dec n)`|Return n decremented by 1|`>>> (dec 5) => 4`| +|`(inc n)`|Return n incremented by 1|`>>> (inc 5) => 6`| |`(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|| |`(third l)`|Returns third element of list|| |`(fourth l)`|Returns fourth element of list||