Skip to content

elif doesn't work #781

Closed
Closed

Description

@KyleSanderson

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.

Activity

  1. antonmedv commented on Apr 7, 2025

    @antonmedv
    Member

    elif, you mean else if? =))

    True, Else if should be added.

  2. KyleSanderson commented on Apr 11, 2025

    @KyleSanderson
    Author

    What would an implementation of this look like? Any examples I can look at where you have a conditional branch?

  3. h2hoang commented on Jul 23, 2025

    @h2hoang

    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
    }
    
  4. added this to the v1.17.7 milestone on Sep 18, 2025
  5. antonmedv commented on Dec 14, 2025

    @antonmedv
    Member

    Added support for else if in #879

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions