Skip to content

.. can't be chained #58763

Open
Open
@rokke-git

Description

@rokke-git

in the precedence and associativity table we claim that : and .. are identical precedence and left-associative. this is true for :, but a..b..c is an error.

the rest of the prec-colon operators ( … ⁝ ⋮ ⋱ ⋰ ⋯ .… .⁝ .⋮ .⋱ .⋰ .⋯) are the same.

found this when writing a helper function to make writing n-d list comprehensions nicer:
iter..x = Iterators.product((iter for _ in 1:x)...)
[foo(a,b,c) for (a,b,c) in 1:n..3]

Metadata

Metadata

Assignees

No one assigned

    Labels

    parserLanguage parsing and surface syntax

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions