add import example
This commit is contained in:
1 parent
2649e2e946
commit
80973ceb8c
5 files changed
+26
No files matched your search
@@ -2,3 +2,4 @@ init/init
|
||||
factorial/factorial
|
||||
datatypes/datatypes
|
||||
appending/appending
|
||||
import/import
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
TARGET := import
|
||||
DFLAGS := -funittest -J.
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(TARGET).d
|
||||
|
||||
%: %.d
|
||||
gdc -o $@ $(DFLAGS) $<
|
||||
|
||||
clean:
|
||||
-rm -f *.o *~ $(TARGET)
|
||||
@@ -0,0 +1 @@
|
||||
This is file1
|
||||
@@ -0,0 +1,2 @@
|
||||
This is file2
|
||||
It has two lines.
|
||||
@@ -0,0 +1,9 @@
|
||||
import std.stdio;
|
||||
|
||||
void main(string[] args)
|
||||
{
|
||||
writefln("file1:");
|
||||
writefln(import("file1"));
|
||||
writefln("file2/file2:");
|
||||
writefln(import("file2/file2"));
|
||||
}
|
||||
Reference in new issue
Block a user