Sorry, what I was trying to suggest was to support both styles.

Please keep me informed of the decision, so I can contribute a PR to ExDoc to 
support the feature.


On Sat, 20 Oct 2018 09:58:59 +0200
José Valim <jose.va...@plataformatec.com.br> wrote:

> I think in some cases we skip arities. Maybe in the Task module, so we
> would have Task.start_link/1,3, which is not handled by 1-3. :)
> 
> 
> *José Valim*
> www.plataformatec.com.br
> Skype: jv.ptec
> Founder and Director of R&D
> 
> 
> On Sat, Oct 20, 2018 at 4:13 AM eksperimental <eksperimen...@autistici.org>
> wrote:
> 
> > Thanks for bring this up, as I thought the same way.
> > Also we need to add support for this in ExDoc.
> >
> > I'm all for using ",".
> > I have also found myself using Mod.fun/1-3
> > when refering to functions with default arguments.
> > I find it cleaner than using commas when referring to the same function
> > with default args
> >
> >
> > On Mon, 1 Oct 2018 12:48:39 -0700 (PDT)
> > Fernando Tapia Rico <fertap...@gmail.com> wrote:
> >
> > > Unfortunately, there isn’t a standard way to refer to functions with
> > > multiple arities in the documentation. That leads to inconsistencies:
> > some
> > > places use an asterisk `fun/*`
> > > <
> > https://github.com/elixir-lang/elixir/blob/master/lib/mix/lib/mix/config.ex#L15>;
> >
> > > others a list of arities separated by comma `fun/1,2`
> > > <
> > https://github.com/elixir-lang/elixir/blob/master/lib/elixir/test/elixir/string_test.exs#L29>;
> >
> > > others a list of arities separated by slashes `fun/1/2
> > > <
> > https://github.com/elixir-lang/elixir/blob/master/lib/elixir/pages/Compatibility%20and%20Deprecations.md#table-of-deprecations>`;
> >
> > > and others just the name of the function `fun`
> > > <
> > https://github.com/elixir-lang/elixir/blob/master/lib/ex_unit/lib/ex_unit/case.ex#L24-L25
> > >
> > > .
> > >
> > > Moreover, ExDoc’s auto-linking does not work with any of those
> > expressions
> > > <https://hexdocs.pm/ex_unit/ExUnit.Callbacks.html#on_exit/2>, loosing
> > one
> > > of the features that I personally find really useful. In fact, that's
> > how I
> > > was planning to encourage the usage of the agreed syntax.
> > >
> > > After inspecting the Elixir codebase, I’ve found that `fun/1,2` is the
> > most
> > > popular expression, and that seems the format used in the Erlang
> > > documentation <http://erlang.org/doc/man/io_lib.html#fwrite-2>. I'll go
> > > with that.
> > >
> > > Regarding ExDoc, I would use the first arity to create the link (Erlang
> > > documentation seems to do the same). For example `Module.fun/1,2` would
> > > link to `Module.html#fun/1`; and `Module.fun/4,3` to
> > `Module.html#fun/4`. I
> > > like this option because it allows developers to control were the link
> > is
> > > going to point to. I’ve discarded the option of creating multiple
> > anchors
> > > like `#fun/1,2` to avoid the combinatorial explosion of cases like
> > > `#fun/1,2,3,4`.
> > >
> > > As a final note, I'm not sure what to do regarding `fun/*` syntax. ExDoc
> > > could link to the function with lowest arity, but I would like to hear
> > some
> > > opinions regarding that.
> > >
> > > Thoughts?
> > >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "elixir-lang-core" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to elixir-lang-core+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/elixir-lang-core/20181020091333.0d4da8bd.eksperimental%40autistici.org
> > .
> > For more options, visit https://groups.google.com/d/optout.
> >
> 

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/20181021063924.3a0e400a.eksperimental%40autistici.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to