sort tests added
This commit is contained in:
parent
f7992b1eab
commit
c104e3ce85
16
Readme.md
16
Readme.md
|
|
@ -3,11 +3,10 @@
|
||||||
- see malformed_program - wrong parsing of comments - probably comment with "
|
- see malformed_program - wrong parsing of comments - probably comment with "
|
||||||
|
|
||||||
### TODO
|
### TODO
|
||||||
- use file suffix .lsp instead of .lisp
|
- test whether AIG,,,10 csv row is parsed
|
||||||
- support for (), nil, t
|
- support for (), nil, t
|
||||||
- print-table
|
- print-table
|
||||||
- download 1 year of data from api.nasdaq.com into test dir
|
- download 10 years of data from api.nasdaq.com into test dir
|
||||||
- support for including lisp libs at startup from dir
|
|
||||||
- documentation
|
- documentation
|
||||||
- rename data.csv and add more tickers
|
- rename data.csv and add more tickers
|
||||||
- logical operators
|
- logical operators
|
||||||
|
|
@ -19,19 +18,22 @@
|
||||||
- add instrumentation (time, nr of evals, debug info, debug environment etc)
|
- add instrumentation (time, nr of evals, debug info, debug environment etc)
|
||||||
- in casting functions (as_string..) better exception description
|
- in casting functions (as_string..) better exception description
|
||||||
- add better print (syntax high-lighting)
|
- add better print (syntax high-lighting)
|
||||||
- add comman line options -h -v
|
- add command line options -h -v
|
||||||
- readline
|
- readline
|
||||||
- execute system command should capture stderr
|
- execute system command should capture stderr
|
||||||
- add sleep
|
- add builtin sleep
|
||||||
- add built in for and, or
|
- add built in for and, or
|
||||||
- file functions
|
- file functions
|
||||||
- name it here
|
- name it here
|
||||||
- string functions
|
- string functions
|
||||||
- name it here
|
- compare - needed for sorting
|
||||||
|
- uppper/lower case
|
||||||
- regexp functions
|
- regexp functions
|
||||||
- date support
|
- date support
|
||||||
- decode-universal-time
|
- decode-universal-time
|
||||||
- anv function
|
- env functions
|
||||||
|
- get env
|
||||||
|
- set env
|
||||||
- add hash datatype
|
- add hash datatype
|
||||||
- conversion functions like parse-integer
|
- conversion functions like parse-integer
|
||||||
- list function nth
|
- list function nth
|
||||||
|
|
|
||||||
10
debug.lsp
10
debug.lsp
|
|
@ -34,9 +34,15 @@
|
||||||
|
|
||||||
(print (len csv_list))
|
(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) (= (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")
|
(print "Debug ends")
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,8 @@
|
||||||
(+ n (scitej (- n 1)))
|
(+ n (scitej (- n 1)))
|
||||||
))
|
))
|
||||||
|
|
||||||
(print (scitej 4000))
|
;; (print (scitej 4000))
|
||||||
; (print (scitej 5))
|
(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 '(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)) ))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue