Skip to content

Have some form of destructing if #1529

Closed
@kevina

Description

@kevina

Having to constantly write code like this:

alt optional_value {
  some (value)  { do something; }
  _ {/*do nothing*/}
}

Is unnecessary verbose in my opinion, and gets annoying to have to constantly write. I would like to be able to say something like:

if (let some(value) = optional_value) {
  do something;
}

Although it doesn't have to be that exact syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions