From bf0a939093b58b4c8fcebfd485b7d6c5c3296503 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 25 Sep 2026 12:07:32 +0700 Subject: [PATCH] A dyn negation of a non-number is refused by name, and a prelude function shadowed in a live session is a recorded gap --- TODO.org | 5 +++++ test/dyn_ops.c | 2 ++ test/test_dyn.ml | 1 + 3 files changed, 8 insertions(+) diff --git a/TODO.org b/TODO.org index 77327b25..6302f1c7 100644 --- a/TODO.org +++ b/TODO.org @@ -1514,6 +1514,11 @@ are a dyn vector. Rules out the first element typing the rest. * Dev loop +** TODO A prelude function shadowed live is reached by the prelude's own calls +A defn of a prelude function's name sent to a running =flan dev= installs into the +host's cell for that name, so the prelude's calls compiled into the host follow it; +a rebuild gives them the prelude's again, as =Check.shadow_prelude= intends. + ** DONE The dev loop, step 1: the reload primitive A list of top-level forms is recompiled and installed into a running process, and call sites compiled before those forms existed follow them through an indirection diff --git a/test/dyn_ops.c b/test/dyn_ops.c index dd9eb728..bc58eb0e 100644 --- a/test/dyn_ops.c +++ b/test/dyn_ops.c @@ -985,6 +985,8 @@ static void refuse(const char *what) { if (strcmp(what, "add") == 0) (void)FDYN_add(flan_dyn_from_i64(3), t); else if (strcmp(what, "sub") == 0) (void)FDYN_sub(flan_dyn_nil(), flan_dyn_from_i64(1)); + else if (strcmp(what, "neg") == 0) + (void)flan_dyn_neg(t, NULL, 0); else if (strcmp(what, "mul") == 0) (void)FDYN_mul(flan_dyn_from_bool(1), flan_dyn_from_i64(2)); else if (strcmp(what, "div") == 0) diff --git a/test/test_dyn.ml b/test/test_dyn.ml index 8152b9cf..4969e4d9 100644 --- a/test/test_dyn.ml +++ b/test/test_dyn.ml @@ -205,6 +205,7 @@ let () = let refusals = [ ("add", "dyn +: int and text"); ("sub", "dyn -: nil and int"); + ("neg", "dyn -: text, and it takes a number"); ("mul", "dyn *: bool and int"); ("div", "dyn /: vec and int"); ("rem", "dyn %: int and nil");