expr
expr copied to clipboard
elif doesn't work
Amazing how expr has cloned a lot of external built-ins. We're very close to this doing native filtering with else if conditional branching.
elif, you mean else if? =))
True, Else if should be added.
What would an implementation of this look like? Any examples I can look at where you have a conditional branch?
I think the implementation should be something more generics, i.e. support multiple conditions and multiple exprs and reduce if/elif/else into it, or support new syntax entirely like: switch { case con1: case con2: ... default: }
type MultiConditionalNode struct {
base
Conds []Node
Exprs []Node
DefaultExpr Node
}