aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/generator/procedure.jvm.lux
blob: 258d9068989ddfd57147e825ab9c397f335f65b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(;module:
  lux
  (lux (control monad)
       (data text/format
             maybe
             (coll ["d" dict])))
  (luxc ["&" base]
        (lang ["ls" synthesis])
        (generator (procedure ["&&;" common])
                   (host ["$" jvm]))))

(def: #export (generate-procedure generate name args)
  (-> (-> ls;Synthesis (Lux $;Inst)) Text (List ls;Synthesis)
      (Lux $;Inst))
  (default (&;fail (format "Unknown procedure: " (%t name)))
    (do Monad<Maybe>
      [proc (d;get name &&common;procedures)]
      (wrap (proc generate args)))))