elvish_config/lib/moi/util/condition.elv

21 lines
231 B
Plaintext
Raw Normal View History

2020-03-13 14:03:36 +00:00
fn set [c t f]{
if $c {
put $t
} else {
put $f
}
}
fn mset [c t f]{
explode (set $c $t $f)
}
fn call [c t f @argv]{
local:v = (set $c $t $f)
if (is (kind-of $v) fn) {
$v $@argv
} else {
put $v
}
}