version 0.2
try, throw implemented help screen updates some code reorganisation readme and doc updates
This commit is contained in:
24
debug.lsp
24
debug.lsp
@@ -1,6 +1,20 @@
|
||||
(write-file "/tmp/f.txt" "line 1\nline 2\nline3")
|
||||
(read-file-lines "/tmp/f.txt" (lambda (ln) (print ln)))
|
||||
(define fc 5)
|
||||
(define sc 5)
|
||||
|
||||
(define counter (lambda (ln) (do (set! ii (+ ii 1)) t ii))))
|
||||
(define ii 0)
|
||||
(print (read-file-lines "/tmp/f.txt" counter))
|
||||
(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)))))
|
||||
|
||||
(print "first thread id:" first_tid)
|
||||
(print "second thread id:" second_tid)
|
||||
(threads-join)
|
||||
(print "ok")
|
||||
|
||||
(try
|
||||
(ls-dir "nonexisting/dir")
|
||||
(print "dir not exists"))
|
||||
|
||||
(try
|
||||
(throw "my-exception")
|
||||
(print "exception caught:" ml-exception))
|
||||
|
||||
(/ 1 0)
|
||||
Reference in New Issue
Block a user