[erlang-questions] (Non)Parametrized modules, inheritance, and R15B02 issues?
Tomas Morstein
tmr@REDACTED
Sun Oct 7 12:32:05 CEST 2012
Hello,
We wanted to upgrade our development environment to R15B02
and ended up with a problem of different inheritance behaviour:
https://gist.github.com/3846164
The point is simple, let's imagine scenario:
- standard module a.erl with several core functions
(acts like abstract class)
- parametrized module b.erl that extends a.erl
to bring all the a's functionality
(b has always a single parameter what is proplist)
On older version of Erlang/OTP, this worked fine
and we were able to b:new ([]) what gave us {b, []}.
This does not work on R15B02 anymore :-(
We don't want to make a.erl parametrized for many reasons,
but I understand it makes some sense to bring a "base" (a)
instance with the instance of b.
The new behaviour still conforms to Richard Carlsson's paper,
because our scenario was not presented there...
The problem I see is that only the case of non-parametrized
BASE "class" has changed in R15B02...
Do we need to completely refactor our code? (add a custom
new/1 to each b-level module, turn module 'a' into a parametrized
one, etc.) How many changes are expected in future? Is it safe
to believe that once we refactor the code, no future version
will change something else?
Should we think about an alternative of doing inheritance
in our custom way otherwise?
Thanks,
Tom
--
www.idea.cz | www.mumps.cz | www.openvms.cz | www.fooboo.org
More information about the erlang-questions
mailing list