Re: Automatic imports?

2017-02-04 Thread crimaniak via Digitalmars-d

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!"



Re: Automatic imports?

2017-02-03 Thread Walter Bright via Digitalmars-d

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" ?




Automatic imports?

2017-02-03 Thread Ali Çehreli via Digitalmars-d

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