elvish_config/lib/moi/util/condition.elv

21 lines
230 B
Plaintext

fn cset [c t f]{
if $c {
put $t
} else {
put $f
}
}
fn mset [c t f]{
all (cset $c $t $f)
}
fn call [c t f @argv]{
local:v = (cset $c $t $f)
if (is (kind-of $v) fn) {
$v $@argv
} else {
put $v
}
}