From 811c37dca47110194c6135be16b05f55dc798973 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 20 Sep 2026 13:09:04 +0700 Subject: [PATCH] Two sentences said more than was checked MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The defconst divergence is dated from the history rather than asserted, and the claim that it is the backends' only disagreement is gone — x86.ml has unsupported paths of its own. --- FIX.org | 3 ++- lib/emit.ml | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/FIX.org b/FIX.org index 52a4bd4..29d454b 100644 --- a/FIX.org +++ b/FIX.org @@ -830,7 +830,8 @@ globals at all. form: a computed [defconst] would be guarded exactly like a computed [defvar]. The x86 backend does guard one; the LLVM backend refuses the program instead, because [Emit.const] has nowhere to run a computed value. - That divergence is older than this rule and is noted here rather than fixed. + That divergence predates the re-run rule — the refusal landed in 495629f and + the flags in 931cf86 — and is noted here rather than fixed. - If the language grows a [def]-style form that re-evaluates, that form recomputes on every run. None exists today and none was invented for this; the rule is written so that adding one is a new case and not a revision. diff --git a/lib/emit.ml b/lib/emit.ml index 49f294f..fbb9525 100644 --- a/lib/emit.ml +++ b/lib/emit.ml @@ -3427,8 +3427,9 @@ let startup_sym = fname ".init-globals" over the form — nothing below asks [gconst]. A [defconst] with a computed initialiser would therefore be guarded here like any [defvar], and on the x86 backend it is. On this one it never arrives: [const] refuses a computed - [defconst] by name, because a constant has nowhere to run. The two backends - disagree about that program and only about that program. + [defconst] by name, because a constant has nowhere to run. So the two + backends disagree about that one program, and the disagreement is older + than this rule. So each computed initialiser guards itself with a flag of its own. Per global and not per startup function, because the rule belongs to the form: