Yeah, I do not think you can do that right now. It seems a very specific parsing issue the fact that the help> prompt is not able to show Base.< or similar entries.
But be careful that, in your case, you didn’t overload the Base.< operator, you defined a new one, and inside your module < won’t work anymore for any other type except the ones you defined (note that your example does not work, but you don’t have < defined anymore for integers, thus your Foo.< function errors).
No, because Main.(x) denotes a “dot call”, equivalent to broadcast(Main, x).
It’s certainly true that there are many different syntactic styles Julia could have chosen. We could have chosen to be more like Python, or more like Rust, or more like Lisp. But the fact of the matter is we have chosen a syntax, and it’s all inter-related — you can’t just change one aspect without changing everything else. Nor is Julia at the stage of development where we are changing basic syntactic structures (see PSA: Julia is not at that stage of development anymore), and any new syntax must be added in a carefully nonbreaking way and to solve a real problem, not just because we want a slightly different spelling.
(You may think Main.:foo is not “sensible”, but in fact this is very consistent with Julia’s metaprogramming facilities, which require a way of “quoting” symbols.)
:($(Expr(:incomplete, "incomplete: premature end of input")))
To have a sensible language, whether something counts a complete expression, a single syntactic “unit”, shouldn’t generally depend on what comes after it. We don’t want to parse x .> y as a binary operation but then parse x .> as something completely different.
Of course, you are free to implement your own language with your own syntax and whatever context-dependent grammar strikes your fancy, maybe even as a front-end for Julia if you want.
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.