def var
import ezx@1.11.0.0/src/share/env.bend as Envimport Base
import ezx@1.11.0.0/src/share/args.bend as Args
14# what a variable holds, with a default for when it holds nothing
15def var(name: String, +alt: String) -> IO(String):
16 do IO<String>:
17 r : Result<&1, &1, U32 & String, String> <- IO.get_env(name)
18 return or_else(Args.text_of(r), alt)