ref: d438cbf5a395ddb1eb383afb44389832dda6ee5a
dir: /libstd/env.myr/
use "sleq.use" use "extremum.use" pkg std = extern var _environment : byte[:][:] const getenv : (name : byte[:] -> [byte[:], bool]) /* FIXME: should return an option, not a tuple, but we have a compiler bug. */ ;; const getenv = {name var i var n for i = 0; i < _environment.len; i++ n = min(name.len, _environment[i].len) if sleq(name, _environment[i][:n]) && sleq(_environment[i][n:n+1], "=") -> (_environment[i][n+1:], true) ;; ;; -> ("", false) }