elvish_config/lib/moi/util/condition.elv

21 lines
228 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]{
var v = (cset $c $t $f)
if (is (kind-of $v) fn) {
$v $@argv
} else {
put $v
}
}