On Thursday, 29 November 2012 at 10:25:40 UTC, Walter Bright wrote:
On 11/29/2012 6:40 PM, Jacob Carlborg wrote:
On 2012-11-29 03:00, Walter Bright wrote:

An attribute would bring along with it the notion of having some static constructors care about dependencies and others not. A pragma would be
global to the module.

Why can't the attribute be global to the module?


Because attributes attach to the declarations they enclose. A global attribute would be something else.

What's wrong with attaching the annotation to the module declaration?
i.e.
@no_circular_ctors module foobar;

Ideally, I'd like to have the reverse default - require an explicit import _inside_ the static ctor when a dependency actually exists. Seems to me that in the vast majority of cases this is the actual preferred choice by users and for the tiny (if any) percent that depend on the current behavior - they'll just get an easy to fix compile-error - e.g. symbol foo.bar is missing, solvable by adding the relevant import. Of course, such a change should be properly announced and documented per the other thread about the development process of D.

Reply via email to