Function conch_runtime::eval::alternative
[−]
[src]
pub fn alternative<P: ?Sized, W, E: ?Sized>(
strict: bool,
param: &P,
alternative: Option<W>,
env: &E,
cfg: TildeExpansion
) -> Alternative<W::EvalFuture> where
P: ParamEval<E, EvalResult = W::EvalResult>,
W: WordEval<E>,
Constructs future representing a Alternative parameter substitution evaluation.
First, param will be evaluated and if the result is non-empty, or if the
result is defined-but-empty and strict = false, then alternative will be
evaluated and yielded.
Otherwise, Fields::Zero will be returned (i.e. the value of param).
Note: field splitting will neither be done on the parameter, nor the alternative word.