blob: 9f5f61d594b79b7a0491c3c77cce479e4abea109 (
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
|
(;module:
lux
(lux (control [monad #+ do]
["ex" exception #+ exception:])
(data [maybe]
[text]
text/format
(coll [dict])))
(luxc ["&" base]
(lang ["la" analysis]))
(. ["./;" common]
["./;" host]))
(exception: #export Unknown-Procedure)
(def: procedures
./common;Bundle
(|> ./common;procedures
(dict;merge ./host;procedures)))
(def: #export (analyse-procedure analyse eval proc-name proc-args)
(-> &;Analyser &;Eval Text (List Code) (Meta la;Analysis))
(<| (maybe;default (&;throw Unknown-Procedure proc-name))
(do maybe;Monad<Maybe>
[proc (dict;get proc-name procedures)]
(wrap ((proc proc-name) analyse eval proc-args)))))
|