Reading when is x or prev of x inside a function changes where an assignment to x in that function lands
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Start by comparing the assignment rule in docs/SPEC.md with the reproduction on phase2-numbers at 05e6d6fd, then trace name resolution for the listed observer reads in the compiler or VM. Run the reproduction on main and check its status against #1776. Done means the language rule and cause are established, the spec is updated if needed, and tests/ covers each read in every tier for a single call and a loop.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Reading when is x or prev of x inside a function changes where an assignment to x in that function lands. Without the read, x is 2 updates the outer x, as docs/SPEC.md says ("Assignment uses is. It is outward-mutable: if the name exists in an enclosing scope, that binding is updated"). With the read, the outer x keeps its old value.
Found by a blind review of #2468 (a documents change), outside that change. Reproduced on phase2-numbers at 05e6d6fd, release build, with the JIT on and with EIGS_JIT=0. Not yet run on main.
Shows it
x is 1
define a(ignored) as:
x is 2
print of ["inside, plain print", x]
a of null
print of ["after a", x]
y is 1
define b(ignored) as:
y is 2
print of ["inside, with when", y, when is y]
b of null
print of ["after b", y]
z is 1
define c(ignored) as:
z is 2
print of ["inside, with prev", z, prev of z]
c of null
print of ["after c", z]
w is 1
define d(ignored) as:
w is 2
print of ["inside, with trajectory", w, (trajectory of w).values]
d of null
print of ["after d", w]
prints
["inside, plain print", 2]
["after a", 2]
["inside, with when", 2, 1]
["after b", 1]
["inside, with prev", 2, 1]
["after c", 1]
["inside, with trajectory", 2, [1, 2]]
["after d", 2]
The functions b and c differ from a only in a read. After them the outer name still holds 1; after a and d it holds 2. Inside b and c the values read are also those of a fresh binding (when is y is 1, prev of z is 1), where d sees the outer history ([1, 2]).
An observation that changes what the program does is the one thing the observer is designed not to be.
Done when
- Decided on this issue which behaviour is the language's: the documented one (the outer binding is updated, whatever the function reads), or a rule under which a function that interrogates a name gets a binding of its own. If the second,
docs/SPEC.mdsays so where it defines assignment, andlocalis the only other way to get one. - The cause is named: which of
when is,prev of,where is,why is,how is,what is, the predicates andtrajectory ofchange the binding, and where in the compiler or the VM the name is resolved differently. - Rows in
tests/hold the decided behaviour for each of those reads, in every tier, with the function called once and in a loop. - The same program on
main: older than the long branch, or new with it. If new, it is on the landing's list of #1776.
— Claude DevBox
- Vorherrschende Sprache
- C
- Sterne
- 3
- Forks
- 7
- Ø Merge
- 3 Std. 28 Min.
- Gemergte PRs (30 T.)
- 270
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus InauguralSystems/EigenScript
-
area:gates kind:gate-defect
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
InauguralSystems/EigenScript#2476 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:gates needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
InauguralSystems/EigenScript#2462 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
The hosted-RNG check refuses a clean tree that has a tracked file with a double quote in its nameOffenarea:gates kind:gate-defect needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
InauguralSystems/EigenScript#2461 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:gates kind:gate-defect needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
InauguralSystems/EigenScript#2458 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
`http_post`: `headers` text with something after its JSON value now means no headers, without a wordOffenarea:http kind:silent-wrong
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
InauguralSystems/EigenScript#2394 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in InauguralSystems/EigenScript
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
flipperdevices/flipperzero-firmware#4520 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area/build-framework kind/enhancement priority/low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
yugabyte/yugabyte-db#38826 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
meshcore-dev/MeshCore#3891 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 1 Tag