add import example

This commit is contained in:
Josh Holtrop 2013-02-07 22:44:50 -05:00
parent 2649e2e946
commit 80973ceb8c
5 changed files with 26 additions and 0 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ init/init
factorial/factorial factorial/factorial
datatypes/datatypes datatypes/datatypes
appending/appending appending/appending
import/import

13
import/Makefile Normal file
View 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
View File

@ -0,0 +1 @@
This is file1

2
import/file2/file2 Normal file
View File

@ -0,0 +1,2 @@
This is file2
It has two lines.

9
import/import.d Normal file
View File

@ -0,0 +1,9 @@
import std.stdio;
void main(string[] args)
{
writefln("file1:");
writefln(import("file1"));
writefln("file2/file2:");
writefln(import("file2/file2"));
}