define renamed to def, defun renamed to defn

This commit is contained in:
vaclavt
2022-01-25 19:50:59 +01:00
parent 62015c2ff8
commit e6f61c9d9f
14 changed files with 189 additions and 189 deletions

20
wip.lsp
View File

@@ -1,4 +1,4 @@
(define l '(nil 1 2 3))
(def l '(nil 1 2 3))
(print (filter (lambda (e) (eval e)) l))
(print (filter (lambda (eval e) (print e)) l))
@@ -10,13 +10,13 @@
(thread-sleep 1)
(thread-create
(define code (tcp-client "127.0.0.1" 7777 ("abcd" "xyz")))
(def code (tcp-client "127.0.0.1" 7777 ("abcd" "xyz")))
(for c code
(print "executing code:" c)
(eval (parse c))
)
(define code (tcp-client "127.0.0.1" 7777 "abcd"))
(def code (tcp-client "127.0.0.1" 7777 "abcd"))
(print "executing code:" code)
(eval (parse code))
)
@@ -41,9 +41,9 @@
;; (define create_tbl_sql "create table prices (datetime integer, symbol varchar(8), prev_close float, open float, price float, change float, change_prct varchar(16))")
;; (define insert_sql "insert into prices (datetime, symbol, prev_close, open, price, change, change_prct) values (1626979443, 'MPC', 54.08, 53.82, 53.63, -0.832101, '-0.83 %')")
;; (define select_sql "select to_string(datetime, '%d.%m.%Y %H:%M:%S'), symbol, prev_close, open, price, change, change_prct from prices")
;; (def create_tbl_sql "create table prices (datetime integer, symbol varchar(8), prev_close float, open float, price float, change float, change_prct varchar(16))")
;; (def insert_sql "insert into prices (datetime, symbol, prev_close, open, price, change, change_prct) values (1626979443, 'MPC', 54.08, 53.82, 53.63, -0.832101, '-0.83 %')")
;; (def select_sql "select to_string(datetime, '%d.%m.%Y %H:%M:%S'), symbol, prev_close, open, price, change, change_prct from prices")
;; (print (usql create_tbl_sql))
@@ -61,11 +61,11 @@
;; (read-url "https://api.nasdaq.com/api/calendar/dividends/")
;; (define fc 5)
;; (define sc 5)
;; (def fc 5)
;; (def sc 5)
;; (define first_tid (thread-create (while (> fc 0) (do (thread-under-lock "ilock" (do (set! fc (dec fc))(print 1))) (thread-sleep 500)))))
;; (define second_tid (thread-create (while (> sc 0) (do (thread-under-lock "ilock" (do (set! sc (dec sc))(print 2))) (thread-sleep 750)))))
;; (def first_tid (thread-create (while (> fc 0) (do (thread-under-lock "ilock" (do (set! fc (dec fc))(print 1))) (thread-sleep 500)))))
;; (def second_tid (thread-create (while (> sc 0) (do (thread-under-lock "ilock" (do (set! sc (dec sc))(print 2))) (thread-sleep 750)))))
;; (print "first thread id:" first_tid)
;; (print "second thread id:" second_tid)