February 03, 2017
On 02/03/2017 03:33 PM, Walter Bright wrote:

>> On 2/3/17 10:41 AM, Daniel N wrote:

>>> auto fun_time(imp!"std.datetime".SysTime tm)

> We need to give this technique a memorable name (not an acronym).

If it's going to stay "imp" (which I initially found confusing; How about "Import"?), "the imp idiom" might do but imps have a very insignificant appearance in Harry Potter. (There are "Pepper Imps sold at Honeydukes in Hogsmeade".)

Ali

February 04, 2017
On Friday, 3 February 2017 at 23:33:58 UTC, Walter Bright wrote:
> I agree, it's pretty dazz! We need to give this technique a memorable name (not an acronym). I thought "Voldemort Types" turned out rather well, whereas CTFE is klunky, UFCS is even worse. The absolute worst is C++ SFINAE.
>
> Any ideas?
>
>   Scherkl-Nielsen Lookup?
>
> The perfect bikeshedding moment!
>
> Daniel, Dominikus: please consider writing an article about this.

That's obviously a self important lookup.
February 03, 2017
On 02/03/2017 06:43 AM, Dominikus Dittes Scherkl wrote:
> DIP 1005 provides new syntax to make it possible to avoid global imports.

I haven't followed DIP 1005 closely. Has there been any discussion of automatic imports that seems to have potential to make both the user's and implementor's lives easier:

void foo(std.datetime.Duration dur) {
    // ...
}

Can the compiler automatically import std.datetime for both the implementation above and the user? Or, too much beer at work on this Friday? :o)

Ali

February 03, 2017
On 2/3/2017 4:01 PM, Ali Çehreli wrote:
> void foo(std.datetime.Duration dur) {
>     // ...
> }
>
> Can the compiler automatically import std.datetime for both the implementation
> above and the user? Or, too much beer at work on this Friday? :o)

How does the compiler know that "std" is supposed to be an import rather than a misspelling of a previously declared "stc" ?

February 03, 2017
On 02/03/2017 06:50 PM, Ali Çehreli wrote:
> "the imp idiom" might do but imps have a very
> insignificant appearance in Harry Potter.

But they have much significance in Doom :)

...part of which takes place on Phobos ;)
February 04, 2017
On Friday, 3 February 2017 at 21:23:22 UTC, Daniel Nielsen wrote:

> I just had to try one more thing. It never ceases to amaze me what is possible in D today.
 Yes, all except of good IDE and tooling.

>
> template imp(string mod) { mixin("import imp = " ~ mod ~ ";"); }
... because of string mixins.


February 04, 2017
On Saturday, 4 February 2017 at 11:50:50 UTC, crimaniak wrote:
> On Friday, 3 February 2017 at 21:23:22 UTC, Daniel Nielsen wrote:
>
>> I just had to try one more thing. It never ceases to amaze me what is possible in D today.
>  Yes, all except of good IDE and tooling.
>
>>
>> template imp(string mod) { mixin("import imp = " ~ mod ~ ";"); }
> ... because of string mixins.

please refrain from insulting string-mixins.
they are by far the most understandable of meta-programming facilities.

February 04, 2017
On Saturday, 4 February 2017 at 00:43:14 UTC, Walter Bright wrote:
> On 2/3/2017 4:01 PM, Ali Çehreli wrote:
>> void foo(std.datetime.Duration dur) {
>>     // ...
>> }
>>
>> Can the compiler automatically import std.datetime for both the implementation
>> above and the user? Or, too much beer at work on this Friday? :o)
>
> How does the compiler know that "std" is supposed to be an import rather than a misspelling of a previously declared "stc" ?
 std.datetime exists.
 I think, allowing fully qualified names and automatic importing of used fully qualified names will be much, much better, than introduction of string mixins literally everywhere.

Woody_and_Buzz_jpg!"String mixins! They are everywhere!"

February 04, 2017
On Saturday, 4 February 2017 at 11:56:52 UTC, Stefan Koch wrote:

> please refrain from insulting string-mixins.
> they are by far the most understandable of meta-programming facilities.
 Most understandable don't mean "good to use". We can do many things with it but it's really hack and easy way to obscure code and prevent any automatic analysis of it. Because when we have string mixin in code - any tool should become a compiler to work with it. So my opinion: they must be avoided as much as possible.



February 04, 2017
On 2/3/17 6:50 PM, Ali Çehreli wrote:
> On 02/03/2017 03:33 PM, Walter Bright wrote:
>
>>> On 2/3/17 10:41 AM, Daniel N wrote:
>
>>>> auto fun_time(imp!"std.datetime".SysTime tm)
>
>> We need to give this technique a memorable name (not an acronym).
>
> If it's going to stay "imp" (which I initially found confusing; How
> about "Import"?), "the imp idiom" might do but imps have a very
> insignificant appearance in Harry Potter. (There are "Pepper Imps sold
> at Honeydukes in Hogsmeade".)
>
> Ali

https://github.com/dlang/druntime/pull/1756 -- Andrei