From e5625dd840a8b8adc76987f649da254335d3d93a Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 11 Aug 2022 16:50:42 -0400 Subject: Improved exception-definition macro. --- lux-lua/source/program.lux | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lux-lua/source') diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux index 3292b7feb..8a88b7d79 100644 --- a/lux-lua/source/program.lux +++ b/lux-lua/source/program.lux @@ -8,7 +8,7 @@ [control ["[0]" maybe] ["[0]" try (.only Try)] - ["[0]" exception (.only exception)] + ["[0]" exception (.only Exception)] ["[0]" io (.only IO io)] ["[0]" function] [concurrency @@ -168,7 +168,8 @@ (schedulingContextFactory [] net/sandius/rembulan/runtime/SchedulingContextFactory) (call [net/sandius/rembulan/StateContext java/lang/Object [java/lang/Object]] "try" [java/lang/Object])) - (exception (unknown_kind_of_object [object java/lang/Object]) + (exception.def (unknown_kind_of_object object) + (Exception java/lang/Object) (exception.report (list ["Class" (ffi.of_string (java/lang/Object::toString (java/lang/Object::getClass object)))] ["Object" (ffi.of_string (java/lang/Object::toString object))]))) @@ -225,7 +226,7 @@ {try.#Failure error})) {try.#Success output})))) - (exception .public nil_has_no_lux_representation) + (exception.def .public nil_has_no_lux_representation) (def (read host_object) Translator @@ -446,7 +447,8 @@ (panic! (exception.error ..unknown_kind_of_object [(as java/lang/Object field)]))))) ))) - (exception (cannot_apply_a_non_function [object java/lang/Object]) + (exception.def (cannot_apply_a_non_function object) + (Exception java/lang/Object) (exception.report (list ["Non-function" (ffi.of_string (java/lang/Object::toString object))]))) -- cgit v1.2.3