until maco wip
This commit is contained in:
@@ -77,6 +77,7 @@ utils/local_install.sh
|
|||||||
- multiline editing (see kilocpp editor)
|
- multiline editing (see kilocpp editor)
|
||||||
|
|
||||||
#### Doc
|
#### Doc
|
||||||
|
- add doc for macros
|
||||||
- add functions from stdlib into doc
|
- add functions from stdlib into doc
|
||||||
- doc for set!
|
- doc for set!
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
(defmacro until (cnd body)
|
||||||
(list 'while '(not (eval cnd))
|
(list 'while '(not (eval cnd))
|
||||||
|
|||||||
@@ -78,6 +78,11 @@
|
|||||||
body
|
body
|
||||||
))
|
))
|
||||||
|
|
||||||
|
(defmacro until (cnd body)
|
||||||
|
(list 'while '(not (eval cnd))
|
||||||
|
body
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
; return 1 when list contains item otherwise nil
|
; return 1 when list contains item otherwise nil
|
||||||
(defn member (lst itm)
|
(defn member (lst itm)
|
||||||
|
|||||||
Reference in New Issue
Block a user