The --> operator now lowers to a :call expression, so it can be defined as a function like other operators.
I originally took this to mean that in earlier versions, you had to use the infix syntax to define it, but that doesn’t seem to work:
julia> a --> b = a + b
ERROR: syntax: invalid assignment location "a --> b" around REPL:1
So in versions before Julia 1.6, was --> just available as syntax for macros to manipulate, but nothing else? Is it possible to define behaviour for it like you can with other operators, for eg. a // b = a + b or //(a, b) = a + b, in Julia 1.0 to 1.5?
PS: The infix definition syntax for --> doesn’t work even in current Julia versions, which I think should be a bug? -->(a, b) = a + b works in Julia 1.6 and above, but a --> b = a + b leads to the same error as above.
I guess this is covered by the next part of the NEWS.md
For backwards compatibility, --> still parses using its own expression head instead of :call.
Since it doesn’t get parsed as a function call, but as its own special expression, it doesn’t get the usual benefit that the infix-form can be used as a definition. Unfortunate inconsistency (for eg. other arrows like <--can be defined with the infix syntax), but one of the sacrifices made for backwards compatibility.
I guess this also kind of answers my original question - the infix syntax in Julia 1.5 and below would also have parsed into this same special expression, so can’t be used to define behaviour for -->.
So could someone explain what it means for --> to have been available as an operator in Julia <=1.5? Does it just mean that the parser won’t complain about it, and so in practice the only use for it would be in custom DSL syntax using macros?