<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div class="h5"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

I was wondering what the general consesus was (if there is one) on whether it&#39;s<br>
valuable to always put module declarations in each module.<br>
</blockquote></div></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div class="h5"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I can&#39;t think of any particularly strong reasons to have it or not to have it.<br>
My first reaction is to just always use it, but thinking about it, I&#39;m not sure<br>
that there&#39;s really much point if the file name and the module name already<br>
match. Does anyone have reasons why it would matter other than personal<br>
preference?<br>
</blockquote><br></div></div></blockquote><div><br>I can see two reasons to use module declarations:<br><br>- you can put documentation comments before the module declaration, to have them at the beginning of the docs. That&#39;s where you put general indications on the use of this module, and copyright/author/license indications. I quite like these module-level docs, personally. <br>
<br>- it defines a new symbol, which you can use in template with alias parameters and __traits, like in __traits(allMembers, moduleName). If you&#39;re into compile-time introspection, that can be useful.<br>(though maybe these symobols exist even without module decls, I don&#39;t know).<br>
<br><br>Philippe<br><br></div></div>