Skip to content

Contains behavior is confusing #24

Closed
@epage

Description

@epage

Currently, the expression hash.contains(5) gets translated to contains(hash).eval(&5). If you understand that context, it makes sense. If you are coming from another language that uses in or contains operators, it gets confusing (the expression 4 < 5 gets translated to: lt(5).eval(&4))

  • Some languages have an in operator. So 5 in hash would naturally translate to in(hash).eval(&5).
  • Some languages flip that and have a contains operator. So hash contains 5 would naturally translate to contains(5).eval(&hash).

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUncertainty is involved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions