diff --git a/scripts/macros.fe b/scripts/macros.fe new file mode 100644 index 0000000..e6bcffa --- /dev/null +++ b/scripts/macros.fe @@ -0,0 +1,27 @@ + + +(= push (mac (val lst) + (list '= lst (list 'cons val lst)) +)) + + +(= for (mac (item lst . body) + (list 'do + (list 'let 'for-iter lst) + (list 'while 'for-iter + (list 'let item '(car for-iter)) + '(= for-iter (cdr for-iter)) + (cons 'do body) + ) + ) +)) + + +(= items (list "cat" "dog" "fox")) + +(push "owl" items) +(push "cow" items) + +(for x items + (print ">" x) +)