D import idiom compilation time

FR86 fr58426 at gmail.com
Sun Jan 6 15:45:57 UTC 2019


On Sunday, 6 January 2019 at 12:11:41 UTC, Daniel N wrote:
> On Saturday, 5 January 2019 at 23:44:31 UTC, H. S. Teoh wrote:
>> On Sat, Jan 05, 2019 at 10:48:30PM +0000, Dgame via 
>> Digitalmars-d wrote: [...]
>>> Output:
>>> 
>>> ----
>>> Hallo
>>> core.exception.AssertError at onlineapp.d(20): Symbol
>>> "thisFunctionDoesNotExist" not found in std.stdio
>>> ----------------
>>> ??:? _d_assert_msg [0x3c00dc54]
>>> onlineapp.d:20 pure nothrow @nogc @safe void
>>> onlineapp.FailedSymbol!("thisFunctionDoesNotExist",
>>> "std.stdio").FailedSymbol!(immutable(char)[]).FailedSymbol(immutable(char)[])
>>> [0x3c00ceac]
>>> onlineapp.d:52 _Dmain [0x3c00c8c3]
>>> ----
>>
>> Impressive!  Though we pretty much had to bring out the 
>> nuclear warhead to get here. :-D  By this point I wonder if it 
>> has already made the original reason for doing this moot 
>> compared to just directly importing the symbol! :-P
>>
>>
>> T
>
> Nice, just surprised it took this long, I made the opDispatch 
> snippet challenge in the blog nearly 2 years ago. I had assumed 
> people would jump all over it. (like you now did in this 
> thread).
>

Really nice! I like it so much, I've taken the liberty to wrap it 
up as a dub package: https://code.dlang.org/packages/localimport.
As I'm a total noob on all this, please let me know if I messed 
anything up or stepped on anybody's toes with this.

FR


More information about the Digitalmars-d mailing list