[OS]EnvabstractREAD-ONLY access to the process environment. Mutation is deliberately absent: the C environment is process-global state that other threads (workers, the blocking I/O pool) may be reading concurrently, so setting variables would be a soundness hazard. Listings are sorted by name, and entries that are not valid UTF-8 are skipped rather than mangled.
Conveniences over the native [OS] namespace (src/runtime/os.rs). Kept in Quoin because they only compose the native primitives — no reason to spend a native method (or a block call from Rust) on either.
The whole environment as a Map, sorted by name -- and, via Map, the way to get the Iterate combinators (select:, collect:, ...) over the environment (a namespace class has no instances to mix into).
The value of the variable, or nil when unset. An empty value is '', not nil -- 'FOO=' is set. A name or value that is not valid UTF-8 reads as nil.
([OS]Env.at:'PATH').defined? "* -> true
The value of name, or the block's value when unset. nil is only ever "unset": a variable with an empty value reads as '', so the fallback does not fire for FOO=.
[OS]Env.at:'QN_SURELY_UNSET' ifAbsent:{ 'fallback' } "* -> fallback
Whether the variable is set at all, empty value included.
[OS]Env.contains?:'PATH' "* -> true
How many environment variables are set.
Iterate the environment as KeyValuePairs, sorted by name. .asMap is the general door — it carries the whole Iterate mixin (select:, collect:, detect:, …), which a namespace class cannot mix in for itself.
Every variable name, as a List of Strings sorted by name.