-
Notifications
You must be signed in to change notification settings - Fork 6
/
macros-core.mal
74 lines (67 loc) · 1.21 KB
/
macros-core.mal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
;; Copied from mal/core.mal from the Mal project
(def! _macro? (fn* [x]
(if (map? x)
(contains? x :__MAL_MACRO__)
false)))
(def! core_ns
[['= =]
['throw throw]
['nil? nil?]
['true? true?]
['false? false?]
['number? number?]
['string? string?]
['symbol symbol]
['symbol? symbol?]
['keyword keyword]
['keyword? keyword?]
['fn? fn?]
['macro? _macro?]
['pr-str pr-str]
['str str]
['prn prn]
['println println]
['readline readline]
['read-string read-string]
['slurp slurp]
['< <]
['<= <=]
['> >]
['>= >=]
['+ +]
['- -]
['* *]
['/ /]
['time-ms time-ms]
['list list]
['list? list?]
['vector vector]
['vector? vector?]
['hash-map hash-map]
['map? map?]
['assoc assoc]
['dissoc dissoc]
['get get]
['contains? contains?]
['keys keys]
['vals vals]
['sequential? sequential?]
['cons cons]
['concat concat]
['vec vec]
['nth nth]
['first first]
['rest rest]
['empty? empty?]
['count count]
['apply apply]
['map map]
['conj conj]
['seq seq]
['with-meta with-meta]
['meta meta]
['atom atom]
['atom? atom?]
['deref deref]
['reset! reset!]
['swap! swap!]])