August 02, 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.



March 06, 2022
On Tuesday, 27 July 2021 at 09:20:25 UTC, Petar Kirov [ZombineDev] wrote:
> On Tuesday, 27 July 2021 at 05:07:32 UTC, ag0aep6g wrote:
>> On 26.07.21 14:55, Andrei Alexandrescu wrote:
>>> On 7/24/21 3:52 PM, qxi wrote:
>> [...]
>>>> import[std.datetime].SysTime
>>>> import{std.datetime}.SysTime
>>>> import std.datetime..SysTime
>>>> import std.datetime::SysTime
>>>> std.datetime::SysTime
>>> 
>>> import:std.datetime.SysTime
>>
>> module(std.datetime).SysTime
>
> That's the best suggestion so far.

No one suggested:

import.std.datetime:SysTime

Seems concise and grammatically unambiguous.
March 06, 2022

On Sunday, 6 March 2022 at 05:21:12 UTC, Zach Tollen wrote:

>

On Tuesday, 27 July 2021 at 09:20:25 UTC, Petar Kirov [ZombineDev] wrote:

>

On Tuesday, 27 July 2021 at 05:07:32 UTC, ag0aep6g wrote:

>

On 26.07.21 14:55, Andrei Alexandrescu wrote:

>

On 7/24/21 3:52 PM, qxi wrote:
[...]

>

import[std.datetime].SysTime
import{std.datetime}.SysTime
import std.datetime..SysTime
import std.datetime::SysTime
std.datetime::SysTime

import:std.datetime.SysTime

module(std.datetime).SysTime

That's the best suggestion so far.

No one suggested:

import.std.datetime:SysTime

Seems concise and grammatically unambiguous.

import.identifier may be grammatically unambiguous but is potentially the opposite of that for the humans.

Visual noise is underrated - code should be concise but syntax should be loud.

March 06, 2022

On Sunday, 6 March 2022 at 06:06:59 UTC, max haughton wrote:

>

On Sunday, 6 March 2022 at 05:21:12 UTC, Zach Tollen wrote:

>

No one suggested:

import.std.datetime:SysTime

Seems concise and grammatically unambiguous.

import.identifier may be grammatically unambiguous but is potentially the opposite of that for the humans.

Visual noise is underrated - code should be concise but syntax should be loud.

I agree, except that syntax highlighters could easily make this particular syntax loud with distinctive colorings. Even without any training they would already be highlighting 'import'. But it's a valid point.

March 06, 2022
On Friday, 23 July 2021 at 13:55:34 UTC, Andrei Alexandrescu wrote:
> Mathias Lang just told me the bug preventing inline imports from working has been fixed, so I reopened this:
>
> https://github.com/dlang/druntime/pull/1756
>
> I think it's a very useful facility, more clearly so for large projects, and deserves a fair shake of the stick.
>
> If it works well in practice, a future language proposal could take `_import!"std.datetime".SysTime` to the simpler and better `import(std.datetime).SysTime`. Using it as a library facility seems like a good step.

What an ugly approach.
When one invents "import std;" others have tendance using import per every symbol.

March 06, 2022
On Sunday, 6 March 2022 at 19:44:07 UTC, Temtaime wrote:
> What an ugly approach.
> When one invents "import std;" others have tendance using import per every symbol.

You should note this thread is 7 months old. I brought it back because I thought it should get more attention.
1 2 3 4
Next ›   Last »