DIP10005: Dependency-Carrying Declarations is now available for community feedback
Timon Gehr via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jan 4 18:18:17 PST 2017
On 05.01.2017 01:51, Andrei Alexandrescu wrote:
> On 12/31/16 9:43 AM, Timon Gehr wrote:
>> On an unrelated note: I'm still not a fan of the with(import) syntax as
>> it morally promotes a lack of turtles (even if not technically so).
>
> Could you please provide more detail? Thanks! -- Andrei
The declaration
with(import foo){ ... }
looks like an orthogonal combination of some import expression and the usual
with(foo){ ... }
statement. (This is true for all other statements and expressions with
similar syntax.)
However, this is not in fact true here, the two constructs have
different scoping rules.
Hence I think that the 'with(import foo){ ... }'-syntax would be better
split into two orthogonal features:
1. allow 'import foo' as an expression that evaluates to the
corresponding module symbol.
2. add 'static with' that is basically like 'with' but is a declaration
and has different scoping rules.
I.e., my objection is that 'with' should not become 'static' just
because it is applied to an import expression.
More information about the Digitalmars-d
mailing list