diff options
author | Eduardo Julian | 2018-04-25 22:50:15 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-04-25 22:50:15 -0400 |
commit | fac2fa47c11db08596c890290bae09bf57a27089 (patch) | |
tree | 3ecf21857d43b5f630c114277e111682e493567a /new-luxc/source/luxc/lang/translation/common-lisp/procedure.jvm.lux | |
parent | 7d539a83fd55f7ced7657302054e099955b55ae2 (diff) |
- Initial Common Lisp back-end implementation.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/common-lisp/procedure.jvm.lux | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/procedure.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/procedure.jvm.lux new file mode 100644 index 000000000..0b9fa3544 --- /dev/null +++ b/new-luxc/source/luxc/lang/translation/common-lisp/procedure.jvm.lux @@ -0,0 +1,29 @@ +(.module: + lux + (lux (control [monad #+ do] + ["ex" exception #+ exception:]) + (data [maybe] + text/format + (coll [dict]))) + (luxc ["&" lang] + (lang ["ls" synthesis] + (host ["_" common-lisp #+ Expression]))) + [//] + (/ ["/." common] + ["/." host])) + +(exception: #export (Unknown-Procedure {message Text}) + message) + +(def: procedures + /common.Bundle + (|> /common.procedures + (dict.merge /host.procedures))) + +(def: #export (translate-procedure translate name args) + (-> (-> ls.Synthesis (Meta Expression)) Text (List ls.Synthesis) + (Meta Expression)) + (<| (maybe.default (&.throw Unknown-Procedure (%t name))) + (do maybe.Monad<Maybe> + [proc (dict.get name procedures)] + (wrap (proc translate args))))) |