History

Added scripts/macros.fe

rxi committed 7 years ago

Commit 0f074a91 parent 8e4ab6b1 file · +27 −0Browse files

Unified · Split

scripts/macros.fe+27−0
@@ -0,0 +1,27 @@
1+
2+
3+(= push (mac (val lst)
4+ (list '= lst (list 'cons val lst))
5+))
6+
7+
8+(= for (mac (item lst . body)
9+ (list 'do
10+ (list 'let 'for-iter lst)
11+ (list 'while 'for-iter
12+ (list 'let item '(car for-iter))
13+ '(= for-iter (cdr for-iter))
14+ (cons 'do body)
15+ )
16+ )
17+))
18+
19+
20+(= items (list "cat" "dog" "fox"))
21+
22+(push "owl" items)
23+(push "cow" items)
24+
25+(for x items
26+ (print ">" x)
27+)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t