diff --git a/Readme.md b/Readme.md index 3bd9a2a..8ed006a 100644 --- a/Readme.md +++ b/Readme.md @@ -4,6 +4,7 @@ ### TODO - support for (), nil, t, in lsp code replace 0 by nil in logicals +- casting to string (like ti int and to float) - some performance functionality (at least counting how many times symbol was evaluated) - documentation - add url of source/inspiration to clib/*.cpp diff --git a/debug.lsp b/debug.lsp index 5b7945f..20ae9cf 100644 --- a/debug.lsp +++ b/debug.lsp @@ -21,9 +21,3 @@ (term-blue (sprintf "%.2f" (list 1.11))) " " (term-yellow (sprintf "%.2f" (list 1.11))) " " )) - - ;; (define q_change_str (sprintf "%+.2f %%" (list q))) - ;; (if (>= q_change 0.0) - ;; (define q_change_str (term-green q_change_str)) - ;; (define q_change_str (term-red q_change_str))) - diff --git a/doc/Doc.md b/doc/Doc.md index 84edeb8..a64a7ea 100644 --- a/doc/Doc.md +++ b/doc/Doc.md @@ -43,27 +43,27 @@ |`(member list item)`|Returns true (1) when list contains item|| |`(uniq list)`|Returns list with removed duplicates || |`(make-list len)`|Return list with len nil elements|`(make-list 3) => (nil nil nil)`| -|`(make-list-of len value)`||| +|`(make-list-of len value)`|Return list with len value elements|| |`(map ..)`||`(map (lambda (x) (+ x 10)) '(1 2 3 4 5 6)) => (11 12 13 14 15 16)`| |`(filter lambda list)`||`(filter (lambda (x) (> x 2)) '(1 2 3 4 5)) => (3 4 5)`| |`(reduce lambda acumulator list)`||`>>> (reduce (lambda (x y) (+ (* x 10) y)) 0 '(1 2 3 4)) => 1234`| -|`(exit ..)`||| -|`(quit ..)`||| -|`(print ..)`||| -|`(input ..)`||| -|`(random ..)`||| -|`(include ..)`||| -|`(read-file ..)`||| -|`(write-file ..)`||| -|`(read-url ..)`||| -|`(system-cmd ..)`||| -|`(ls-dir ..)`||| +|`(exit code)`|Exit the program with an integer code|| +|`(quit code)`|Same as (exit ..)|| +|`(print ..)`|Print several values and return the last one|| +|`(input [prompt])`|Get user input with an optional prompt|| +|`(random low high)`|Get a random number between two numbers inclusively|| +|`(include file)`|Read a file and execute its code|| +|`(read-file filename)`|Get the contents of a file|| +|`(write-file filename)`|Write a string to a file|| +|`(read-url url [headers])`|Reads URL|Returnd list (status_code content)| +|`(system-cmd command_str)`|Execute system command|| +|`(ls-dir ..)`|List a dir|List of directory entries| |`(is-file? ..)`|Returns true if passed filename is a file|| |`(is-dir? ..)`|Returns true if passed filename is a directory|| -|`(parse-csv ..)`||| -|`(parse-json ..)`||| +|`(parse-csv string)`|Parse CSV string|| +|`(parse-json json_string)`|Parse JSON string|| |`(save-csv ..)`||| -|`(get-universal-time ..)`||| +|`(get-universal-time)`|Get current time as secs from epoch|| |`(date-to-str ..)`||| |`(str-to-date ..)`||| |`(date-add ..)`||| @@ -77,4 +77,6 @@ |`(eval ..)`||| |`(type ..)`||| |`(parse ..)`||| +|`(make-list size)`||| +|`(make-list-of size value)`||| |`(xx ..)`|||