From d6609df8201d65d84670d0572d254099dd832833 Mon Sep 17 00:00:00 2001 From: dzaima Date: Sat, 20 May 2023 14:26:25 +0300 Subject: [PATCH] =?UTF-8?q?reserve=20=E2=80=A2CurrentError=20with=20namesp?= =?UTF-8?q?ace=20=F0=9D=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/system.md | 2 +- src/builtins/sysfn.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/system.md b/docs/system.md index 088e8b5c..3eed7e03 100644 --- a/docs/system.md +++ b/docs/system.md @@ -83,7 +83,7 @@ May be removed or renamed in the future. Get the current error message while within the catch side of `⎊`. Dynamically-scoped. -Might return a more informative object in the future (e.g. whether the error came from an `!`, the compiler or a builtin, maybe stacktrace reading, etc; such a format is TBD). +Argument must not be a namespace, as that is reserved for future changes. ## `•internal` diff --git a/src/builtins/sysfn.c b/src/builtins/sysfn.c index 4e1f25c4..c35493fa 100644 --- a/src/builtins/sysfn.c +++ b/src/builtins/sysfn.c @@ -704,6 +704,7 @@ B repl_c1(B t, B x) { #if CATCH_ERRORS B lastErrMsg; B currentError_c1(B t, B x) { + if (isNsp(x)) thrM("•CurrentError: Namespace 𝕩 is reserved"); dec(x); if (q_N(lastErrMsg)) thrM("•CurrentError: Not currently within any ⎊"); return inc(lastErrMsg);