begin -> do

Shorter and doesn't imply existence of `end'
This commit is contained in:
2026-09-14 15:48:17 +03:00
parent af6e778185
commit d609a0c591
7 changed files with 9 additions and 9 deletions

View File

@@ -24,7 +24,7 @@
;; atom-to-fmt-c
(test '%fun (atom-to-fmt-c 'fn))
(test '%prototype (atom-to-fmt-c 'prototype))
(test '%block-begin (atom-to-fmt-c 'begin))
(test '%block-begin (atom-to-fmt-c 'do))
(test '%define (atom-to-fmt-c 'define))
(test '%pointer (atom-to-fmt-c 'pointer))
(test '%array (atom-to-fmt-c 'array))

View File

@@ -79,7 +79,7 @@
" (break))" ; 45
" (default" ; 46
" (putchar 120)))" ; 47
" (begin" ; 48
" (do" ; 48
" (var bvar int 121)" ; 49
" (putchar bvar))" ; 50
" (goto done)" ; 51

View File

@@ -39,7 +39,7 @@
(pub defmacro (list-for-each list-type list-var elt-type elt-var what-do)
(let ((list-var-2 (cat list-var '-2)))
`(begin
`(do
(var ,list-var-2 (* ,list-type) ,list-var)
(var ,elt-var ,elt-type (-> ,list-var-2 value))
(while (!= (-> ,list-var-2 next) NULL)