elvish_config/lib/moi/util/condition.elv

21 lines
227 B
Plaintext

fn set [c t f]{
if $c {
put $t
} else {
put $f
}
}
fn mset [c t f]{
all (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
}
}