julia> f1() = begin 0:-1, ""=>"" end;
julia> f2() = begin (0:-1, ""=>"") end;
I expected the same return type for both functions, but:
julia> typeof(f1())
Pair{Tuple{UnitRange{Int64},String},String}
julia> typeof(f2())
Tuple{UnitRange{Int64},Pair{String,String}}
julia> typeof((0:-1, ""=>""))
Tuple{UnitRange{Int64},Pair{String,String}}
julia> typeof(((0:-1, ""=>"")))
Tuple{UnitRange{Int64},Pair{String,String}}
julia> typeof(((0:-1, "")=>""))
Pair{Tuple{UnitRange{Int64},String},String}
It looks like the comma "operator" in a,b has precedence before the => operator.
IMO that is not to be expected and a parsing issue, because the consequence is, that parens
around an expression can change the meaning.
With my restricted insight, I cannot imagine a reason for comma needing a high precedence, when
it appears outside a parenthesized list.
PS: its the same with assignments x1 = 0:-1, ""=>"" etc.
I expected the same return type for both functions, but:
It looks like the comma "operator" in
a,bhas precedence before the=>operator.IMO that is not to be expected and a parsing issue, because the consequence is, that parens
around an expression can change the meaning.
With my restricted insight, I cannot imagine a reason for comma needing a high precedence, when
it appears outside a parenthesized list.
PS: its the same with assignments
x1 = 0:-1, ""=>""etc.