ref: fc1425f6388e112984cce1bf64910be2a656367a
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) }