Skip to content

enhance switch #857

Description

@PhoenixZeng

like kotlin

switch foo
    case 1
        //todo exist like now 
    case 2  ->  //todo but in one line like closure 
    in 3..5
        //todo when foo >= 3 and foo <= 5
    not in 1..10
        //todo when foo < 1 or foo > 10
    case 6|8|80
        // todo when foo equals 6 or 8 or 80
    if this mod 2 == 0
        // todo when foo mod 2 == 0
    or// 'or' or 'else'
        //like default but short

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions