# How to overload operators and their doc bindings

**URL:** <https://discourse.julialang.org/t/how-to-overload-operators-and-their-doc-bindings/87372>\
**Category:** General Usage\
**Created:** [September 16, 2022, 2:07pm UTC](https://discourse.julialang.org/t/how-to-overload-operators-and-their-doc-bindings/87372 "2022-09-16T14:07:16Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![digital\_carver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/digital_carver/32/33818_2.png) [@digital\_carver](https://discourse.julialang.org/u/digital_carver)\
**Post date:** [September 16, 2022, 5:04pm UTC](https://discourse.julialang.org/t/how-to-overload-operators-and-their-doc-bindings/87372/22 "2022-09-16T17:04:44Z")

</div>

> [@stevengj](#):
>
> So, `Main.<` is parsed as the beginning of a comparison `Main .< x` … the parser then starts looking for the next expression `x`.

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

```julia
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.

[Previous page](https://discourse.julialang.org/t/how-to-overload-operators-and-their-doc-bindings/87372.md?page=1)
