diff options
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/procedure.jvm.lux')
-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))))) |