Inline imports redivivus

Atila Neves atila.neves at gmail.com
Mon Aug 2 19:06:06 UTC 2021


On Sunday, 1 August 2021 at 16:03:05 UTC, Daniel N wrote:
> On Sunday, 1 August 2021 at 13:30:55 UTC, Paul Backus wrote:
>> On Sunday, 1 August 2021 at 04:15:33 UTC, Vladimir Panteleev 
>> wrote:
>>>
>>> (import std.datetime).SysTime
>>>
>>> In an expression, import currently can only appear followed 
>>> by '(', so there is no ambiguity.
>>
>> Very elegant; I like it.
>
> It looks reasonable when it appears as a simple statement, but 
> as soon as it's in an expression... it doesn't compose as well.
>
> it will result in ubiquitous double parens.
> if ((import std.datetime).SysTime > deadline)
> -> **

Hmm. This could show up in template constraints.





More information about the Digitalmars-d mailing list