Erlang supports the `-extends` attribute to implement module-level inheritance (http://www.erlang.se/euc/07/papers/1700Carlsson.pdf provides a good description). Is there an equivalent in Elixir?
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group, send email to elixir-lang-co...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
--
It is. It was the other way around some time ago
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
Using the gist that Jose has posted, there seems to be a problem with indirect function calls; it seems that somehow the version from the base module is invoked, even though all the functions are declared as delegates and overridable. The following https://gist.github.com/orenbenkiki/5174435 demonstrates the problem.If I recall correctly, the Erlang module inheritance mechanism does behave correctly in such a case. Is there an Elixir workaround to provide this?
--
defmacro implements(module, protocol: protocol) doquote dodefimpl unquote(protocol), for: unquote(module) doimport Extensionextends unquote(module)endendend
--
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/e6a44f9f-a62f-44f2-9e75-1ebec3d298d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Boris,Simply because it is a pattern we don't want to encourage, as it fully couples a module to another one.And there are questions such as documentation. Are you going to document the delegated functions? If not, why not? Should we copy the delegations? Then the examples are likely outdated.If you feel like you need to delegate a whole module, it is better to re-evaluate the solution and discuss the problem, as it is very unlikely in Elixir.
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/dfdcb2be-9413-4e61-a4a3-c7ebe330d630%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/f3c98522-42c8-4649-b991-3a0d251af45f%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/f3c98522-42c8-4649-b991-3a0d251af45f%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/1CE35E22-6EE4-4570-839D-7484047F4736%40gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/7ab9d547-6581-4079-8337-cc1c9d880af2%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/125852f7-38b2-46d9-8b3e-a3c4989904ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.