docs(repl): Phase 288 documentation cleanup
Updated documentation to reflect actual implementation status: - docs/reference/language/repl.md: Corrected examples (variable persistence TODO) - docs/development/current/main/10-Now.md: Phase 288 completion noted - docs/development/current/main/30-Backlog.md: Updated with Phase 288.1 tasks - docs/development/current/main/phases/phase-288/: Added phase documentation Accurate REPL behavior examples: - x = 1 works (implicit local) - print(x) errors (persistence in Phase 288.1) - Expression auto-display deferred 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
# REPL Mode (Read–Eval–Print Loop) — Specification (SSOT)
|
||||
|
||||
**Status**: Phase 288 MVP Implementation (2025-12-25)
|
||||
**Status**: Phase 288 MVP Implementation (2025-12-25) — partial (dev tool)
|
||||
|
||||
## Philosophy: Two Execution Contexts, One Language
|
||||
|
||||
@ -75,8 +75,8 @@ static box Main {
|
||||
>>> x = 1 // ✅ Implicitly creates session-level local
|
||||
>>>
|
||||
|
||||
>>> print(x) // ✅ Reads from session scope
|
||||
1
|
||||
>>> print(x) // ⏳ Phase 288.1: session→eval bridge needed
|
||||
Error: Undefined variable 'x'
|
||||
|
||||
>>> y // ❌ ERROR: Undefined variable (Fail-Fast)
|
||||
Error: Undefined variable 'y'
|
||||
@ -88,11 +88,9 @@ Hint: Variable not defined. Assign a value first.
|
||||
>>> print(z)
|
||||
3
|
||||
|
||||
>>> 1 + 1 // ✅ Expression auto-display (Phase 288.1+)
|
||||
2
|
||||
>>> 1 + 1 // ⏳ Phase 288.1: expression auto-display
|
||||
|
||||
>>> _ // ✅ Last value stored in _ variable
|
||||
2
|
||||
>>> _ // ⏳ Phase 288.1: last value binding
|
||||
|
||||
>>> .reset // ✅ Clear session
|
||||
Session reset
|
||||
@ -108,6 +106,18 @@ Error: Undefined variable 'x'
|
||||
- Reads of undefined names are errors (Fail-Fast; no silent `void`)
|
||||
- **Implementation**: Session stores runtime values (`VMValue`), not MIR IDs
|
||||
|
||||
## Implementation Status (MVP vs planned)
|
||||
|
||||
Implemented in Phase 288 MVP:
|
||||
- `hakorune --repl` / `-i`
|
||||
- `.help`, `.exit/.quit`, `.reset`
|
||||
- REPL-only session object exists (runtime-value based)
|
||||
- File mode regression gate remains green
|
||||
|
||||
Planned for Phase 288.1:
|
||||
- Session variables visible to subsequent compiled lines (`x = 1` then `print(x)`)
|
||||
- Expression auto-display and `_` last-value binding
|
||||
|
||||
## 2) Binding Rules in REPL Mode
|
||||
|
||||
### 2.1 Implicit local on assignment (key feature)
|
||||
|
||||
Reference in New Issue
Block a user