until maco wip

This commit is contained in:
vaclavt
2022-05-23 21:18:53 +02:00
parent fd8f3c6e06
commit 8e142dc7ea
3 changed files with 11 additions and 0 deletions

View File

@@ -77,6 +77,7 @@ utils/local_install.sh
- multiline editing (see kilocpp editor)
#### Doc
- add doc for macros
- add functions from stdlib into doc
- doc for set!

View File

@@ -1,3 +1,8 @@
(dotimes i 4 (print i) )
(def acc 0)
;(dotimes i 4 (do (set! acc (+ acc i)) (print acc)) )
(print (dotimes i 4 (do (set! acc (+ acc i)) (print acc))) )
(defmacro until (cnd body)
(list 'while '(not (eval cnd))

View File

@@ -78,6 +78,11 @@
body
))
(defmacro until (cnd body)
(list 'while '(not (eval cnd))
body
))
; return 1 when list contains item otherwise nil
(defn member (lst itm)