Two sentences said more than was checked

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.
This commit is contained in:
Joseph Ferano 2026-09-20 13:09:04 +07:00
parent 5b39730f07
commit 811c37dca4
2 changed files with 5 additions and 3 deletions

View File

@ -830,7 +830,8 @@ globals at all.
form: a computed [defconst] would be guarded exactly like a computed form: a computed [defconst] would be guarded exactly like a computed
[defvar]. The x86 backend does guard one; the LLVM backend refuses the [defvar]. The x86 backend does guard one; the LLVM backend refuses the
program instead, because [Emit.const] has nowhere to run a computed value. 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 - 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; 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. the rule is written so that adding one is a new case and not a revision.

View File

@ -3427,8 +3427,9 @@ let startup_sym = fname ".init-globals"
over the form nothing below asks [gconst]. A [defconst] with a computed over the form nothing below asks [gconst]. A [defconst] with a computed
initialiser would therefore be guarded here like any [defvar], and on the 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 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 [defconst] by name, because a constant has nowhere to run. So the two
disagree about that program and only about that program. 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 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: global and not per startup function, because the rule belongs to the form: