diff options
author | Eduardo Julian | 2017-11-06 22:03:42 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-06 22:03:42 -0400 |
commit | 0cb55507c100f6817225e644c2d19e73940edad6 (patch) | |
tree | 8e99d826fc51f052b086f0398b257176dcac11cc /new-luxc/source/luxc/lang/translation/procedure.jvm.lux | |
parent | 69d3bdf98a5be8dd7aacc0b37bdbfcbf226faf62 (diff) |
- Fixed some bugs.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/procedure.jvm.lux | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/new-luxc/source/luxc/lang/translation/procedure.jvm.lux b/new-luxc/source/luxc/lang/translation/procedure.jvm.lux index d74b559cf..82b7c5d44 100644 --- a/new-luxc/source/luxc/lang/translation/procedure.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/procedure.jvm.lux @@ -1,6 +1,7 @@ (;module: lux - (lux (control [monad #+ do]) + (lux (control [monad #+ do] + ["ex" exception #+ exception:]) (data [maybe] text/format (coll [dict]))) @@ -10,6 +11,8 @@ (. ["./;" common] ["./;" host])) +(exception: #export Unknown-Procedure) + (def: procedures ./common;Bundle (|> ./common;procedures @@ -18,7 +21,7 @@ (def: #export (translate-procedure translate name args) (-> (-> ls;Synthesis (Meta $;Inst)) Text (List ls;Synthesis) (Meta $;Inst)) - (<| (maybe;default (&;fail (format "Unknown procedure: " (%t name)))) + (<| (maybe;default (&;throw Unknown-Procedure name)) (do maybe;Monad<Maybe> [proc (dict;get name procedures)] (wrap (proc translate args))))) |