version 0.2

try, throw implemented
help screen updates
some code reorganisation
readme and doc updates
This commit is contained in:
2021-06-10 23:26:14 +02:00
parent b50e9ba128
commit f594437b61
7 changed files with 227 additions and 105 deletions

View File

@@ -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)