changeset 1413:16360a39d709

Re: Compile time function execution... Gregor Richards <Richards@codu.org> 2007-02-15 http://www.digitalmars.com/webnews/newsgroups.php?group=digitalmars.D&article_id=48811
author thomask
date Sun, 11 Mar 2007 11:05:50 +0000
parents 6b1dfd2d1691
children aaf99ec76365
files run/m/mixin_28_A.d run/m/mixin_28_B.d run/m/mixin_28_C.d
diffstat 3 files changed, 99 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/m/mixin_28_A.d	Sun Mar 11 11:05:50 2007 +0000
@@ -0,0 +1,33 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Gregor Richards <Richards@codu.org>
+// @date@	2007-02-15
+// @uri@	http://www.digitalmars.com/webnews/newsgroups.php?group=digitalmars.D&article_id=48811
+// @desc@	Re: Compile time function execution...
+
+module dstress.run.m.mixin_28_A;
+
+int state;
+
+void bar(){
+	state++;
+}
+
+char[] foo(){
+	return "bar();";
+}
+
+int main(){
+	if(0 != state){
+		assert(0);
+	}
+
+	mixin(foo());
+
+	if(1 != state){
+		assert(0);
+	}
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/m/mixin_28_B.d	Sun Mar 11 11:05:50 2007 +0000
@@ -0,0 +1,33 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Gregor Richards <Richards@codu.org>
+// @date@	2007-02-15
+// @uri@	http://www.digitalmars.com/webnews/newsgroups.php?group=digitalmars.D&article_id=48811
+// @desc@	Re: Compile time function execution...
+
+module dstress.run.m.mixin_28_B;
+
+int state;
+
+void bar(){
+	state++;
+}
+
+dchar[] foo(){
+	return "bar();";
+}
+
+int main(){
+	if(0 != state){
+		assert(0);
+	}
+
+	mixin(foo());
+
+	if(1 != state){
+		assert(0);
+	}
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/m/mixin_28_C.d	Sun Mar 11 11:05:50 2007 +0000
@@ -0,0 +1,33 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Gregor Richards <Richards@codu.org>
+// @date@	2007-02-15
+// @uri@	http://www.digitalmars.com/webnews/newsgroups.php?group=digitalmars.D&article_id=48811
+// @desc@	Re: Compile time function execution...
+
+module dstress.run.m.mixin_28_C;
+
+int state;
+
+void bar(){
+	state++;
+}
+
+wchar[] foo(){
+	return "bar();";
+}
+
+int main(){
+	if(0 != state){
+		assert(0);
+	}
+
+	mixin(foo());
+
+	if(1 != state){
+		assert(0);
+	}
+	return 0;
+}