How to overload operators and their doc bindings

I’m curious why this doesn’t then lead to a syntax/parser error, rather than a

Binding Main.< does not exist.

message. This seems to be an actionable side of this issue, where better feedback to the user would help a lot.

Having Main.< lead to a ERROR: syntax: incomplete: premature end of input in the help mode too, just like it does in the normal REPL mode, would be less misleading than saying Binding Main.< does not exist., and would help people look at it as a syntax issue - thus making it more likely they figure it out.
Even better would be, of course, to have additional guidance like “To access operator < under Main, use Main.:< instead”. Perhaps an enhancement to consider when parsing via JuliaSyntax.jl at least.

3 Likes