elvish_config/lib/moi/util/condition.elv

21 lines
228 B
Plaintext
Raw Normal View History

fn cset [c t f]{
2020-03-13 14:03:36 +00:00
if $c {
put $t
} else {
put $f
}
}
fn mset [c t f]{
all (cset $c $t $f)
2020-03-13 14:03:36 +00:00
}
fn call [c t f @argv]{
2021-08-27 20:06:49 +00:00
var v = (cset $c $t $f)
2020-03-13 14:03:36 +00:00
if (is (kind-of $v) fn) {
$v $@argv
} else {
put $v
}
}