blob: 18ce2e24ad688e0ac06bbc8a9c4b8fc096f7c973 (
plain)
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
|
(;module:
lux
(lux (control monad)
(data text/format)
[macro #+ Monad<Lux> "Lux/" Monad<Lux>])
(luxc ["&" base]
(lang ["la" analysis]
["ls" synthesis])
["&;" analyser]
["&;" synthesizer]
(generator ["&;" common]
(host ["$" jvm]
(jvm ["$i" inst])))))
(def: #export generate-unit
(Lux $;Inst)
(Lux/wrap ($i;string &common;unit)))
(do-template [<name> <type> <load> <wrap>]
[(def: #export (<name> value)
(-> <type> (Lux $;Inst))
(Lux/wrap (|>. (<load> value) <wrap>)))]
[generate-bool Bool $i;boolean $i;wrap-boolean]
[generate-nat Nat (|>. (:! Int) $i;long) $i;wrap-long]
[generate-int Int $i;long $i;wrap-long]
[generate-deg Deg (|>. (:! Int) $i;long) $i;wrap-long]
[generate-real Real $i;double $i;wrap-double]
[generate-char Char $i;char $i;wrap-char]
[generate-text Text $i;string id]
)
|