ludic/examples
Orkuncakilkaya ad63f09d53 Phase 7d: string interpolation text {expr} text
The readable way to build strings, as you noted `{a} {b}` beats `a + " " + b`.
A backtick string embeds any expression in `{…}` and desugars to the Phase-7c
`+` chain, wrapping each hole in `str(...)`:

  `hello {name}, n={count + 1}`
    ==  "hello " + name + ", n=" + str(count + 1)

- Lexer: a backtick captures its content raw as TK_INTERP.
- Parser: parse_interp splits literal runs from `{…}` holes (brace-depth aware,
  `{{`/`}}` escape to literal braces), re-lexes each hole as a full expression
  (save/restore toks/pi like an import), and folds it all into E_BIN(+) nodes —
  so no new AST or runtime beyond the existing concat.
- str(x): a string passes through; int/bool/fixed convert via a small emitted
  @fn_int_str prelude (digits from the end of a buffer, '-' for negatives),
  emitted once into any program that uses it.

examples/strings.ludic gains interpolation cases (now prints 1..7); the smoke
covers it. Grammar + ludic_syntax.h tokenize backtick strings (holes highlighted
as embedded code). LANGUAGE.md documents it as the preferred form.

Reseeded (22530 lines); C-free fixpoint holds; goldens identical; 18/18; vocab +
doc-fences clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-28 01:12:07 +03:00
..
chronorift Phase 6f: let = immutable, var = mutable (binding-only) 2026-08-27 23:52:59 +03:00
lib Phase 6f: let = immutable, var = mutable (binding-only) 2026-08-27 23:52:59 +03:00
annotations.ludic Scriptable properties (ECS-safe subset): @Computed and @OnSpawn 2026-08-27 21:01:32 +03:00
chronorift.ludic Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
hello.ludic Phase 6b: a handler's query is @Queries only; drop the signature clauses 2026-08-27 23:20:09 +03:00
lifecycle.ludic Lifecycle hooks: @OnStart/@OnQuit, @OnDespawn, @OnAttach (like @OnSpawn) 2026-08-27 21:15:50 +03:00
menu.ludic Phase 6e: unify builtin naming (loaders domain-first, set_reg) 2026-08-27 23:38:10 +03:00
qdecl.ludic Phase 6b: a handler's query is @Queries only; drop the signature clauses 2026-08-27 23:20:09 +03:00
scenes.ludic Phase 6e: unify builtin naming (loaders domain-first, set_reg) 2026-08-27 23:38:10 +03:00
snake.ludic Phase 6f: let = immutable, var = mutable (binding-only) 2026-08-27 23:52:59 +03:00
strings.ludic Phase 7d: string interpolation text {expr} text 2026-08-28 01:12:07 +03:00
toggle.ludic Phase 6f: let = immutable, var = mutable (binding-only) 2026-08-27 23:52:59 +03:00