Documenter.jl icon indicating copy to clipboard operation
Documenter.jl copied to clipboard

make binding support `->` function

Open clouds56 opened this issue 2 years ago • 3 comments

So that it works for [`x -> sin(x)`](@ref), As well as [`sin(_)`](@ref) if https://github.com/JuliaLang/julia/pull/46633 checked in

clouds56 avatar Sep 06 '22 15:09 clouds56

I am a little hesitant about this.. this feels like a niche usage, and in those rare cases wouldn't it be okay to just write it as [`x -> sin(x)`](@ref sin)? Also, isn't x -> sin(x) technically different from sin?

mortenpi avatar Sep 07 '22 02:09 mortenpi

We both hold the view that x -> sin(x) is the same as sin, so there's no logical problem. The only question here is shall we support this corner case / would it be useful since nobody would write x -> sin(x).

It's common to write sin(_) and after somehow we implement _ as anonymous function it might be translate to x -> sin(x), you could see errors in the build https://buildkite.com/julialang/julia-master/builds/15482#01830cdc-697e-4664-a67f-354ab826efea for more details. And at any level it doesn't hurt since in no case we read x -> sin(x) different from sin.

If you still not sure just leave it until _ is about to land.

clouds56 avatar Sep 07 '22 08:09 clouds56

We both hold the view that x -> sin(x) is the same as sin, so there's no logical problem since in no case we read x -> sin(x) different from sin.

No, I think @mortenpi and I hold the opposite view. x -> sin(x) is a very different object to sin, and they may have different docstrings.

I am not in favor of this.

odow avatar Nov 02 '23 05:11 odow