Re: Is there an alias for standard libraries to use in import statement?

2021-07-04 Thread Bastiaan Veelo via Digitalmars-d-learn
On Sunday, 4 July 2021 at 07:40:44 UTC, BoQsc wrote: I just started with a fresh look at the D language and would like to be able to rewrite this code: import std; void main() { writeln("Hello D"); } Into more readable standard library name: import system; void main() {

Re: Is there an alias for standard libraries to use in import statement?

2021-07-04 Thread BoQsc via Digitalmars-d-learn
On Sunday, 4 July 2021 at 08:50:54 UTC, Mike Parker wrote: You can use named imports, but then you have to use the name as a namespace: ``` import system = std; void main() { system.writeln("Hello D"); } ``` These were the examples that might feel more readable and natural than

Re: Is there an alias for standard libraries to use in import statement?

2021-07-04 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 4 July 2021 at 07:40:44 UTC, BoQsc wrote: I just started with a fresh look at the D language and would like to be able to rewrite this code: import std; void main() { writeln("Hello D"); } Into more readable standard library name: import system; void main() {

Is there an alias for standard libraries to use in import statement?

2021-07-04 Thread BoQsc via Digitalmars-d-learn
I just started with a fresh look at the D language and would like to be able to rewrite this code: import std; void main() { writeln("Hello D"); } Into more readable standard library name: import system; void main() { writeln("Hello D"); } Or into this import library.standard;