Skip to content

Chained comparisons (>, <, etc.) #3

@Toma400

Description

@Toma400

So, simply as, code going T op T op T should be doable, as currently to do that you need to do T op T and T op T, making it less readable. For example:

if 10 < x < 5: # means range between 9 and 6
  discard

# currently, it would be written like below:
if 10 < x and x < 5: discard
# or through range
if x in 6..<10: discard

Obviously it's okay for those to exist, but being able to write it in such a way would be just cool third alternative, imo most readable visually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaNew feature idea

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions