Fixing the Piping/Chaining Issue

The thing is, this is a very different perspective on the language… it’s more of a

https://discourse.julialang.org/t/psa-julia-is-not-at-that-stage-of-development-anymore/44872

Almost applies here. This fundamentally changes major components of the parsing and semantics of the language. I’m not sure how fundamental it is, but @StefanKarpinski might have something to say about this. Right now we have an Expr object that is a call which represents the function name and the arguments. You are asking to parse that thing as a function object and a tuple and then interpret the adjacency of a function and a tuple as “application” but “only if it’s not bound tighter by \> or />”

julia> foo = Meta.parse("f(x)")
:(f(x))

julia> typeof(foo)
Expr

julia> foo.head
:call

julia> foo.args
2-element Vector{Any}:
 :f
 :x

you are asking to fundamentally change the way things parse, so that “f(x,y,z)” will not be parsed as:

julia> Expr(:call,:foo,:x,:y,:z)
:(foo(x, y, z))

but rather something like:

Expr(:adjacency,Expr(:symbol :foo),Expr(:tuple, (:x,:y,:z)))

And then the fact that the two are adjacent implies a call to the function identified by the symbol under some circumstances and not in others…

I mean, this would be a HUGELY breaking change for many many macros for example. It’s a nonstarter for Julia 1 I’m pretty sure.

3 Likes