diff --git a/Readme.md b/Readme.md index 0ebd7d9..f5ce727 100644 --- a/Readme.md +++ b/Readme.md @@ -3,11 +3,10 @@ - see malformed_program - wrong parsing of comments - probably comment with " ### TODO -- use file suffix .lsp instead of .lisp +- test whether AIG,,,10 csv row is parsed - support for (), nil, t - print-table -- download 1 year of data from api.nasdaq.com into test dir -- support for including lisp libs at startup from dir +- download 10 years of data from api.nasdaq.com into test dir - documentation - rename data.csv and add more tickers - logical operators @@ -19,19 +18,22 @@ - add instrumentation (time, nr of evals, debug info, debug environment etc) - in casting functions (as_string..) better exception description - add better print (syntax high-lighting) -- add comman line options -h -v +- add command line options -h -v - readline - execute system command should capture stderr -- add sleep +- add builtin sleep - add built in for and, or - file functions - name it here - string functions - - name it here + - compare - needed for sorting + - uppper/lower case - regexp functions - date support - decode-universal-time -- anv function +- env functions + - get env + - set env - add hash datatype - conversion functions like parse-integer - list function nth diff --git a/debug.lsp b/debug.lsp index 7d5dcb5..6ce1e7c 100644 --- a/debug.lsp +++ b/debug.lsp @@ -34,9 +34,15 @@ (print (len csv_list)) -(define my_tickers '("WFC" "AIG")) +(define my_tickers '("FDX" "C" "AIG" "BAC" "BK" "PBF" "PBFX" "SYF" "WFC" "TEVA" "XOM")) ; (print (filter (lambda (x) (= (first x) "CLX")) csv_list)) -(print (filter (lambda (x) (member my_tickers (first x))) csv_list)) +; (print (filter (lambda (x) (member my_tickers (first x))) csv_list)) +(define csv_list (filter (lambda (x) (member my_tickers (first x))) csv_list)) + + +(define sorted_list (quick-sort-by csv_list (lambda (a b) (> (str-to-date (second a) "%m/%d/%Y") (str-to-date (second b) "%m/%d/%Y"))))) + +(for x csv_list (print x)) (print "Debug ends") diff --git a/tests/test.lsp b/tests/test.lsp index d17b390..a1008ab 100644 --- a/tests/test.lsp +++ b/tests/test.lsp @@ -30,8 +30,8 @@ (+ n (scitej (- n 1))) )) -(print (scitej 4000)) -; (print (scitej 5)) +;; (print (scitej 4000)) +(print (scitej 1000)) @@ -42,6 +42,10 @@ (print "sorted: " (quick-sort '(10 9 8 7 6 5 4 3 2 1))) +(print "sorted: " (quick-sort '(1 2 3 4 5 6 7 8 9 10))) +(print "sorted by: " (quick-sort-by '(10 9 8 7 6 5 4 3 2 1) (lambda (a b) (> a b)) )) +(print "sorted by: " (quick-sort-by '(1 2 3 4 5 6 7 8 9 10) (lambda (a b) (> a b)) )) +(print "sorted by: " (quick-sort-by '(1 2 3 4 5 6 7 8 9 10) (lambda (a b) (< a b)) ))