elvish_config/lib/moi/util/condition.elv

21 lines
227 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]{
2020-07-22 09:24:43 +00:00
all (set $c $t $f)
2020-03-13 14:03:36 +00:00
}
fn call [c t f @argv]{
local:v = (set $c $t $f)
if (is (kind-of $v) fn) {
$v $@argv
} else {
put $v
}
}