ludic/docs/language/text/text-lower.md
Orkuncakilkaya ac1e8d157d
All checks were successful
docs / build-and-deploy (push) Successful in 2s
refactor(stdlib): consolidate System.* onto Os.*, retire duplicated members
`System.*` and the newer `Os.*` (added in #21) both covered the environment
around the game, with four members (`arg`, `arg_count`, `env`, `exit`) lowering
byte-for-byte identically and the standard streams overlapping in concern. That
is a user-facing ambiguity (`System.env` vs `Os.env` are indistinguishable) and
a drift hazard (two copy-pasted codegen paths).

Make `Os.*` the single canonical environment/process namespace and retire the
overlapping `System.*` members:

- Remove `System.{arg, arg_count, env, exit, stdout, stderr}` from the namespace
  dispatch (selfhost/emit_expr.ludic). Use `Os.arg`/`Os.arg_count`/`Os.env`/
  `Os.exit` and `Os.stdout_write`/`Os.stderr_write` instead.
- `System.*` now covers only its unique low-level surface: the raw file handles
  (`file_open/read/write/seek/tell/close`), `read_char`, and `run`.
- The bare `arg`/`exit`/`getenv`/`file_stdout`/`file_stderr` intrinsics stay —
  they are the primitive layer the self-hosted compiler itself uses; only the
  redundant *namespaced* sugar is gone.
- Docs: drop the six retired `docs/language/system/*` pages, retune the section
  blurb, update inventory.json and the LSP signature table.
- Secondary finding from the issue: cross-link `Text.upper`/`Text.lower`
  (ASCII-only) to `Unicode.upper`/`Unicode.lower` (full Unicode case mapping).

Reseeded; C-free bootstrap fixpoint holds. All suites green (56 test / 29
selfhost / 29 test-tools); docs cover every implemented feature (291 ns-methods).

Closes #40

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-30 22:54:28 +03:00

22 lines
677 B
Markdown

---
id: text-lower
name: Text.lower
category: text
kind: namespace-method
tokens: Text.lower
sig: Text.lower(s) -> string
tip: A lowercased copy of a string.
order: 12
ns: Text
member: lower
---
Returns a fresh string with every ASCII letter <code>A</code>-<code>Z</code> turned to lowercase; other bytes pass through unchanged. Pair it with <code>Text.equals</code> for case-insensitive matching by lowercasing both sides. This is ASCII-only — accented and non-Latin letters are left as-is; for full Unicode case mapping use <code>Unicode.lower</code>.
```ludic
program Demo {
handler Step phase Update {
if Text.equals(Text.lower(cmd), "quit") { stop() }
}
}
```