ref: ee4f263f0c410a8e1061ff704054f8707cb0cb0c
dir: /libstd/env+posixy.myr/
use sys use "extremum.use" use "option.use" use "sleq.use" pkg std = const getenv : (name : byte[:] -> option(byte[:])) const getenvv : (name : byte[:], default : byte[:] -> byte[:]) ;; const getenv = {name var n for env in sys.__environment n = min(name.len, env.len) if sleq(name, env[:n]) && sleq(env[n:n+1], "=") -> `Some env[n+1:] ;; ;; -> `None } const getenvv = {name, default match getenv(name) | `Some v: -> v | `None: -> default ;; }