ludic/docs/language/operators/op-access.md
Orkuncakilkaya b7745a4600 refactor(lang): rename the str type (and stringify builtin) to string
Expand the abbreviated string type and its conversion builtin to the full
word everywhere:
  str            ->  string        (the immutable-string type)
  str(x) -> str  ->  string(x) -> string   (the stringify builtin;
                                            what `{…}` interpolation calls)

Types are recognized by identifier, and llty maps both spellings to LLVM
`ptr`, so this is an atomic source rewrite: type annotations, the Ludic
type tags, the builtin name/dispatch, and the interpolation desugar, plus
the grammars, LSP, docs (type-str -> type-string, fn-str -> fn-string), and
inventory. int/bool stay (universally accepted, like Math).

Reseeded; C-free fixpoint holds; all suites green (45/24/29); site + check.py OK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-30 01:51:11 +03:00

955 B

id name category kind sig tip order
op-access Member & index operators operator x.field buffer[i] text[a..b] Field access, element index, and string slice — usable as value or target. 6

The access operators reach into a compound value. value.field reads or writes a property field and chains freely (route.next.column); buffer[index] reads or writes one element of a slice or raw buffer; and text[start..end] produces a fresh substring of the bytes in the half-open range, while text[index] reads a single byte as an int code point. Each form works both as a value and as an assignment target, and they compose — route[index].column = 0 is one address computation. Field access also binds method-style calls like Screen.fill_rectangle.

let head_column: int = segments[0].column
segments[0].column = head_column + 1
let extension: string = file_name[len(file_name) - 4 .. len(file_name)]