[erlang-questions] Erlang 19 callbacks aren't attributes?
Tue Jan 24 04:04:48 CET 2017
On Mon, Jan 23, 2017 at 6:28 AM Björn Gustavsson <bjorn@REDACTED> wrote:
> The change was intentional, but we did not foresee that it would
> cause problems.
> There is no formal documentation exactly which attributes should
> appear in module_info(attributes). A long time ago, all attributes
> except 'module', 'export', 'import', 'file', and 'record' were included.
> Well, to that point, the following appears on the Modules reference page (
"Any module attribute can be specified. The attributes are stored in the
compiled code and can be retrieved by calling
Module:module_info(attributes), or by using the module beam_lib(3) in
The most straightforward understanding of that has to be that all
attributes are equally accessible in both places.
When the dialyzer attributes 'type', 'spec', and 'opaque' were introduced
> we decided not to include them to reduce the code size.
> Since 'callback' and 'optional_callback' are attributes that
> are used by dialyzer, we decided that they too should be
> excluded (for consistency).
> That makes sense in a way, but at the same time, it seems very odd for all
of these things to be "attributes", and yet only some of them appear when
you ask the language for the attributes of a module. Regardless of the
intended use of an attribute, why would the platform lie about whether or
not an attribute is present?
Also, what do you mean by "excluded"? As I pointed out in my post, the
attributes are still present in the abstract code. I don't understand
what's saved by having them in one place but not the other.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions