ludic/examples
Orkuncakilkaya 1b9789630a Phase 7h: string slicing s[a..b] (retire substr)
`s[a..b]` is a fresh substring of the bytes [a, b) — the modern, end-based form
of the C-style `substr(s, start, count)`:

  substr(src, start, i - start)   -> src[start..i]
  substr(t, 2, len(t) - 2)        -> t[2..len(t)]
  substr(src, i, 2)               -> src[i..i + 2]

Mechanics: a new E_SLICE postfix (`base[lo..hi]`, distinct from `base[i]`
indexing) lowers to a @fn_str_slice prelude (malloc + copy + terminate), emitted
once into any program that slices. Two reseeds: add the syntax + prelude, then
migrate the 22 substr calls and delete substr. The migrator recognises the
common `count == end - start` shape and emits the clean `s[start..end]` rather
than `s[start..start + (end - start)]`.

examples/strings.ludic gains slicing (now prints 1..9). Reseeded (22673 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:35:24 +03:00
..
chronorift Phase 6f: let = immutable, var = mutable (binding-only) 2026-08-27 23:52:59 +03:00
lib Phase 7e: polymorphic print(x) + str(x) (retire print_int/print_str) 2026-08-28 01:22:38 +03:00
annotations.ludic Phase 7e: polymorphic print(x) + str(x) (retire print_int/print_str) 2026-08-28 01:22:38 +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 7e: polymorphic print(x) + str(x) (retire print_int/print_str) 2026-08-28 01:22:38 +03:00
lifecycle.ludic Phase 7e: polymorphic print(x) + str(x) (retire print_int/print_str) 2026-08-28 01:22:38 +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 7e: polymorphic print(x) + str(x) (retire print_int/print_str) 2026-08-28 01:22:38 +03:00
scenes.ludic Phase 7e: polymorphic print(x) + str(x) (retire print_int/print_str) 2026-08-28 01:22:38 +03:00
snake.ludic Phase 6f: let = immutable, var = mutable (binding-only) 2026-08-27 23:52:59 +03:00
strings.ludic Phase 7h: string slicing s[a..b] (retire substr) 2026-08-28 01:35:24 +03:00
toggle.ludic Phase 7e: polymorphic print(x) + str(x) (retire print_int/print_str) 2026-08-28 01:22:38 +03:00