From 865caaf37d6c0f62133a4e857f2e8f26e424d2c4 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 16 Feb 2013 16:33:40 -0500 Subject: [PATCH] add enum --- .gitignore | 1 + enum/Makefile | 12 ++++++++++++ enum/enum.d | 22 ++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 enum/Makefile create mode 100644 enum/enum.d diff --git a/.gitignore b/.gitignore index 08b3b61..0f300de 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ import/import compclass/compclass copy/copy structcons/structcons +enum/enum diff --git a/enum/Makefile b/enum/Makefile new file mode 100644 index 0000000..5e87cec --- /dev/null +++ b/enum/Makefile @@ -0,0 +1,12 @@ + +TARGET := enum + +all: $(TARGET) + +$(TARGET): $(TARGET).d + +%: %.d + gdc -o $@ $< + +clean: + -rm -f *.o *~ $(TARGET) diff --git a/enum/enum.d b/enum/enum.d new file mode 100644 index 0000000..7d8d4ba --- /dev/null +++ b/enum/enum.d @@ -0,0 +1,22 @@ + +import std.stdio; + +enum +{ + N1, + N2, + N3 +} + +enum E +{ + E1, + E2, + E3 +} + +void main(string[] args) +{ + writefln("%s, %s, %s", N1, N2, N3); + writefln("%s, %s, %s", E.E1, E.E2, E.E3); +}