<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Jan 23, 2017 at 6:28 AM Björn Gustavsson <<a href="mailto:bjorn@erlang.org">bjorn@erlang.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The change was intentional, but we did not foresee that it would<br class="gmail_msg">
cause problems.<br class="gmail_msg">
<br class="gmail_msg">
There is no formal documentation exactly which attributes should<br class="gmail_msg">
appear in module_info(attributes). A long time ago, all attributes<br class="gmail_msg">
except 'module', 'export', 'import', 'file', and 'record' were included.<br class="gmail_msg">
<br class="gmail_msg"></blockquote><div>Well, to that point, the following appears on the Modules reference page (<a href="http://erlang.org/doc/reference_manual/modules.html">http://erlang.org/doc/reference_manual/modules.html</a>):</div><div><br></div><div>"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 STDLIB."</div><div><br></div><div>The most straightforward understanding of that has to be that all attributes are equally accessible in both places.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
When the dialyzer attributes 'type', 'spec', and 'opaque' were introduced<br class="gmail_msg">
we decided not to include them to reduce the code size.<br class="gmail_msg">
<br class="gmail_msg">
Since 'callback' and 'optional_callback' are attributes that<br class="gmail_msg">
are used by dialyzer, we decided that they too should be<br class="gmail_msg">
excluded (for consistency).<br class="gmail_msg">
<br class="gmail_msg"></blockquote><div>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?</div><div><br></div><div>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.</div><div><br></div><div>Ryan</div></div></div>