aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/generator/procedure.jvm.lux
blob: 77828c95264226f3d344167852f5ad5f92c2fb0d (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 #+ do])
       (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 maybe;Monad<Maybe>
      [proc (d;get name &&common;procedures)]
      (wrap (proc generate args)))))