More convenient defdelegate

38 views
Skip to first unread message

Mário Guimarães

unread,
Apr 4, 2019, 12:02:02 PM4/4/19
to elixir-lang-core
Hello

a suggestion:

it would be convenient to write

defdelegate foo/4, ...

instead of having to write

defdelegate foo(a, b, c, d), ...

What do you think?

Thanks
Mário

Mário Guimarães

unread,
Apr 4, 2019, 12:05:28 PM4/4/19
to elixir-lang-core

It should be possible though to support both idioms, that is, the more succint `foo/n` and those supported today.

Rich Morin

unread,
Apr 4, 2019, 12:26:44 PM4/4/19
to elixir-l...@googlegroups.com
Although your proposed syntax is more succinct, I worry that
it would reduce the amount of information available to the
reader. If the developer has chosen expressive function and
parameter names, the reader can get idea of the API without
needing to look further.

-r

Mário Guimarães

unread,
Apr 4, 2019, 12:33:35 PM4/4/19
to elixir-lang-core

It will not reduce the amount of information, which can be found on the target module.

But I understand your point, and that's why I propose the more succinct idiom has an addition to the current idioms.

José Valim

unread,
Apr 4, 2019, 12:47:33 PM4/4/19
to elixir-l...@googlegroups.com
My personal opinion is that, given that the new proposal has loss of lexical information, as mentioned by Rich, it doesn't justify adding another API to defdelegate. The current API was made explicit on purpose.


José Valim
Skype: jv.ptec
Founder and Director of R&D


--
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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/c20cb87e-f248-46d7-8652-51e206826d12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mário Guimarães

unread,
Apr 4, 2019, 1:02:04 PM4/4/19
to elixir-lang-core
Just to add: the current idioms have the inconvenience that we must change the defdelegates in case arguments are renamed.

Thanks


quinta-feira, 4 de Abril de 2019 às 17:47:33 UTC+1, José Valim escreveu:
My personal opinion is that, given that the new proposal has loss of lexical information, as mentioned by Rich, it doesn't justify adding another API to defdelegate. The current API was made explicit on purpose.


José Valim
Skype: jv.ptec
Founder and Director of R&D


On Thu, Apr 4, 2019 at 6:33 PM Mário Guimarães <mario.lui...@gmail.com> wrote:

It will not reduce the amount of information, which can be found on the target module.

But I understand your point, and that's why I propose the more succinct idiom has an addition to the current idioms.


quinta-feira, 4 de Abril de 2019 às 17:26:44 UTC+1, Rich Morin escreveu:
Although your proposed syntax is more succinct, I worry that
it would reduce the amount of information available to the
reader.  If the developer has chosen expressive function and
parameter names, the reader can get idea of the API without
needing to look further.

-r

--
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-l...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages