Repository navigation
Commit 08255de
Destructuring (RG-4b): live in declarations, snapshots in
* Rename the `optimistic` statement to `guess`
`guess x := e` replaces `optimistic x := e` (07 decision 18, ruled
2026-11-11). Semantics and lowering are unchanged (createOptimistic /
createOptimisticStore); only the surface word moves.
- Parsers (ref/src/parse.ts, compiler/src/parse.rs): `guess` is the
keyword; `optimistic` stays reserved and is a parse error coded
OPTIMISTIC whose hint names `guess` (guide/diagnostics.md, S-parse-hints).
- Codes: OPTIMISTIC_OUTSIDE_HOLD -> GUESS_OUTSIDE_HOLD,
OPTIMISTIC_NO_QUESTION -> GUESS_NO_QUESTION, OPTIMISTIC_REVERTED ->
GUESS_REVERTED; HELD_WRITE / STALE_WRITE_BACK / AC-1b messages say `guess`.
- Spec, guide, scenarios, examples, eval reference apps and the editor
grammar use `guess`. eval/results and preregistrations are left as
historical records.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWP7LmQhib6M9zGnmBH
* Don't reserve `optimistic`: it names Solid's primitive, not a keyword
Drops the OPTIMISTIC parse hint, its guide section, spec row and
S-parse-hints variant; 07 decision 18 says why.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWP7LmQhib6M9zGnmBH
* Clear errors with onFlush, not a guess
An error clear is a reset that lands now (EF-8), not a guess at the
server's answer: `guess saveError := ""` worked only because the source
was given a constant question to revert to. The guide's action example,
the examples and the eval reference apps now write
`onFlush(() => { saveError := "" })`, and those error sources are
declared with `:=`. S-ai2-settings gains the flush instant.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWP7LmQhib6M9zGnmBH
* Allow a guess over an equation (Solid's createOptimistic(fn))
`x = e` then `guess x := v` in an action is legal (06 ST-5c, 07 decision
19): a guess is not a write of the truth, and Solid's derived
createOptimistic(fn) has a setter that only guesses. A plain `x := v` on
an equation stays WRITE_TO_NON_SOURCE; `props.x` and parameters stay
refused (O-4). New code GUESS_ON_DEFERRED: a deferred equation lags its
truth (V-16).
Lowering: a guessed equation is createOptimistic(fn), or
createOptimisticStore(fn, seed) when keyed or guessed by path, on the
client, the server (matching owner trees for hydration) and in the oracle.
Both checkers and both emitters agree (crate parity, lowered alike).
Scenario S-guess-equation covers an equation of a source and a child's
equation of a prop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWP7LmQhib6M9zGnmBH
* Destructuring (RG-4b, 07 §5): `{ a, b } = e`, `[x, , y = d] = e`, component signatures, `let { … } = e`
A destructured equation is one equation per name, each a projection of the
right side that keeps updating; a destructuring `let` is one snapshot local
per name, as in JS. Defaults apply on undefined. Rest is not yet supported.
`[n, setN] = createSignal(0)` keeps its JS_API hint.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWP7LmQhib6M9zGnmBH
* Document destructuring: 07 grammar + decision 20, guide/language.md
Bare `x = e` is always an equation, `let x = e` always a snapshot, and only
`:=` and `guess` mutate; destructuring keeps each side's meaning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWP7LmQhib6M9zGnmBH
* Destructuring: rest patterns, `{ a, ...rest }` and `[x, ...rest]`
An object rest is Solid's `omit` of the named keys, a live view (an
internal `omit` expression in every runner and the crate); an array rest is
`.slice(n)`. In a `let`, an object rest is a copy (`{ ...omit(…) }`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWP7LmQhib6M9zGnmBH
---------
Co-authored-by: Claude <noreply@anthropic.com>let (#49)1 parent 0140638 commit 08255de
21 files changed
Lines changed: 513 additions & 44 deletions
File tree
- compiler/src
- guide
- ref
- compile
- oracle
- src
- types
- scenarios
- spec
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
422 | 424 | | |
423 | 425 | | |
424 | 426 | | |
| 427 | + | |
425 | 428 | | |
426 | 429 | | |
427 | 430 | | |
| |||
439 | 442 | | |
440 | 443 | | |
441 | 444 | | |
| 445 | + | |
442 | 446 | | |
443 | 447 | | |
444 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
| 356 | + | |
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
441 | | - | |
| 441 | + | |
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
| |||
2051 | 2051 | | |
2052 | 2052 | | |
2053 | 2053 | | |
2054 | | - | |
| 2054 | + | |
2055 | 2055 | | |
2056 | 2056 | | |
2057 | 2057 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1178 | 1178 | | |
1179 | 1179 | | |
1180 | 1180 | | |
| 1181 | + | |
| 1182 | + | |
1181 | 1183 | | |
1182 | 1184 | | |
1183 | 1185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
| 365 | + | |
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| |||
0 commit comments