add import example
This commit is contained in:
parent
2649e2e946
commit
80973ceb8c
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@ init/init
|
||||
factorial/factorial
|
||||
datatypes/datatypes
|
||||
appending/appending
|
||||
import/import
|
||||
|
13
import/Makefile
Normal file
13
import/Makefile
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
TARGET := import
|
||||
DFLAGS := -funittest -J.
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(TARGET).d
|
||||
|
||||
%: %.d
|
||||
gdc -o $@ $(DFLAGS) $<
|
||||
|
||||
clean:
|
||||
-rm -f *.o *~ $(TARGET)
|
1
import/file1
Normal file
1
import/file1
Normal file
@ -0,0 +1 @@
|
||||
This is file1
|
2
import/file2/file2
Normal file
2
import/file2/file2
Normal file
@ -0,0 +1,2 @@
|
||||
This is file2
|
||||
It has two lines.
|
9
import/import.d
Normal file
9
import/import.d
Normal file
@ -0,0 +1,9 @@
|
||||
import std.stdio;
|
||||
|
||||
void main(string[] args)
|
||||
{
|
||||
writefln("file1:");
|
||||
writefln(import("file1"));
|
||||
writefln("file2/file2:");
|
||||
writefln(import("file2/file2"));
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user