diff options
author | Eduardo Julian | 2017-11-01 00:51:45 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-01 00:51:45 -0400 |
commit | 012f6bd41e527479dddbccbdab10daa78fd9a0fd (patch) | |
tree | 621f344a09acd52736f343d94582b3f1a2f0c5f9 /new-luxc/source/luxc/lang/translation/procedure.jvm.lux | |
parent | 71d7a4c7206155e09f3e1e1d8699561ea6967382 (diff) |
- Re-organized code-generation, and re-named it "translation".
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/procedure.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/procedure.jvm.lux | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/new-luxc/source/luxc/lang/translation/procedure.jvm.lux b/new-luxc/source/luxc/lang/translation/procedure.jvm.lux new file mode 100644 index 000000000..973f0e968 --- /dev/null +++ b/new-luxc/source/luxc/lang/translation/procedure.jvm.lux @@ -0,0 +1,24 @@ +(;module: + lux + (lux (control [monad #+ do]) + (data [maybe] + text/format + (coll [dict]))) + (luxc ["&" base] + (host ["$" jvm]) + (lang ["ls" synthesis])) + (. ["./;" common] + ["./;" host])) + +(def: procedures + ./common;Bundle + (|> ./common;procedures + (dict;merge ./host;procedures))) + +(def: #export (generate-procedure generate name args) + (-> (-> ls;Synthesis (Meta $;Inst)) Text (List ls;Synthesis) + (Meta $;Inst)) + (<| (maybe;default (&;fail (format "Unknown procedure: " (%t name)))) + (do maybe;Monad<Maybe> + [proc (dict;get name procedures)] + (wrap (proc generate args))))) |