launch config update
This commit is contained in:
parent
91f1a8b6c7
commit
adca8a452b
|
|
@ -17,11 +17,11 @@
|
||||||
"MIMode": "lldb"
|
"MIMode": "lldb"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ml -f debug.lsp",
|
"name": "ml -d -f debug.lsp",
|
||||||
"type": "cppdbg",
|
"type": "cppdbg",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceFolder}/build/ml",
|
"program": "${workspaceFolder}/build/ml",
|
||||||
"args": ["-f", "${workspaceFolder}/debug.lsp"],
|
"args": ["-d", "-f", "${workspaceFolder}/debug.lsp"],
|
||||||
"stopAtEntry": false,
|
"stopAtEntry": false,
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"environment": [],
|
"environment": [],
|
||||||
|
|
|
||||||
66
debug.lsp
66
debug.lsp
|
|
@ -1,67 +1,5 @@
|
||||||
|
(print (str-to-date "2021-10-11 16:57:00" "%Y-%m-%d %H:%M:%S"))
|
||||||
(defun find-with-val-sublist (lst name)
|
(print (date-to-str 1633971420 "%Y-%m-%d %H:%M:%S"))
|
||||||
(do
|
|
||||||
; (print "list:" lst " name:" name)
|
|
||||||
(define found_val nil)
|
|
||||||
(define i 0)
|
|
||||||
|
|
||||||
(while (and (>= i 0) (< i (len lst)))
|
|
||||||
(define e (index lst i))
|
|
||||||
; (print "testing element:" e " first e:" (first e))
|
|
||||||
(if (= (type (first e)) "list")
|
|
||||||
(do
|
|
||||||
(set! found_val (find-with-val-sublist (first e) name))
|
|
||||||
(if (!= found_val nil) (set! i -1))
|
|
||||||
)
|
|
||||||
; else
|
|
||||||
(do
|
|
||||||
;(print "compare" (first e) " with " name)
|
|
||||||
(if (= name (first e))
|
|
||||||
(do
|
|
||||||
; (print "found" name)
|
|
||||||
(set! found_val (second e)) (set! i -1)
|
|
||||||
)
|
|
||||||
; else
|
|
||||||
(if (= (type (second e)) "list")
|
|
||||||
(do (set! found_val (find-with-val-sublist (second e) name))
|
|
||||||
(if (!= found_val nil)
|
|
||||||
(set! i -1)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(define i (inc i))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
found_val
|
|
||||||
))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(define str "{\"date_from\":\"2021-10-05\",\"date_to\":\"2021-10-05\",\"earnings\":{\"2021-10-05\":{\"stocks\":[{\"importance\":5,\"symbol\":\"PEP\",\"date\":\"2021-10-05\",\"time\":\"06:00:00\",\"title\":\"PepsiCo\"},{\"importance\":0,\"symbol\":\"SAR\",\"date\":\"2021-10-05\",\"time\":\"16:00:00\",\"title\":\"Saratoga Investment\"}],\"day\":\"Today\",\"month\":\"October\",\"year\":\"2021\",\"date_number\":\"05\",\"selected_copy\":\"PEP and SAR reporting Today\",\"deselected_copy\":\"PEP and SAR reporting Today\"}}}")
|
|
||||||
(define parsed_json (parse-json str))
|
|
||||||
;(print parsed_json "\n")
|
|
||||||
|
|
||||||
(define stocks (find-with-val-sublist parsed_json "stocks"))
|
|
||||||
(print stocks)
|
|
||||||
(for s stocks
|
|
||||||
(print s)
|
|
||||||
(print (find-with-val-sublist parsed_json "date"))
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; (define a 25)
|
|
||||||
;; (cond
|
|
||||||
;; ((> a 30) (print "a > 30"))
|
|
||||||
;; ((> a 20) (print "a > 20"))
|
|
||||||
;; (1 (print "a je" a)))
|
|
||||||
|
|
||||||
;; (define csv_date (str-to-date "01/01/2021" "%m/%d/%Y"))
|
|
||||||
;; (date-to-str 3141583200 "%m/%d/%Y")
|
|
||||||
|
|
||||||
|
|
||||||
;; (define time (get-universal-time))
|
;; (define time (get-universal-time))
|
||||||
;; (str-to-date (date-to-str time "%Y-%m-%d %H:%M:%S") "%Y-%m-%d %H:%M:%S")
|
;; (str-to-date (date-to-str time "%Y-%m-%d %H:%M:%S") "%Y-%m-%d %H:%M:%S")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue