DIP10005: Dependency-Carrying Declarations is now available for community feedback

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Wed Jan 4 07:56:13 PST 2017


On 04.01.2017 16:00, deadalnix wrote:
>
> Nested import are a language simplification. Declaration can appear
> anywhere, import is a declaration, the fact that import couldn't appear
> anywhere was an arbitrary limitation, and removing it makes the language
> simpler. As such, the burden of proof is on maintaining the limitation
> rather than removing it.
> ...

I don't fully agree. Nested imports, the way they have been implemented, 
pose a new symbol hijacking hazard.

(A symbol hijacking anecdote (not directly related): 
https://github.com/tgehr/d-compiler/pull/1#discussion-diff-89697186L85 )

> This DIP is a language addition. Therefore, contrary to nested or lazy
> import, the burden of proof is on it. This DIP should be considered as
> follow: how much complexity does it add and how much benefit does it
> bring, compared to alternatives.

It adds basically no implementation complexity [1]. I consider the 
benefit real, but minor enough to oppose the DIP based on its wacky syntax.


[1] Both static if and static foreach (once it lands) need the same kind 
of scoping rules.


More information about the Digitalmars-d mailing list