Add library/modules/std/cli.sx: a pure-sx command-line argument accessor backed by the macOS C runtime (_NSGetArgv/_NSGetArgc), no compiler change. os_argc() -> s64 os_args(buf: []string) -> []string Zero heap, zero per-arg allocation: os_args fills a caller-provided buffer (stack array) with string VIEWS over the process's own argv block, which lives for the whole process. The returned slice header is a by-value stack return; nothing touches context.allocator. Documents the `sx run` reality: under `sx run <prog.sx> ...` the process argv is the interpreter's argv (sx, run, prog.sx, ...), not a program's logical args. This accessor reports the real process argv truthfully; mapping to logical args is a later consumer concern (distribution P3.1). Non-macOS platforms bail loudly (message + _exit) rather than returning a silent empty. examples/0716-modules-cli-argv.sx asserts only deterministic structural invariants (argc >= 1, argv[0] non-empty, os_argc() == filled length).
1 B
1 B