changeset 766:3636e44bf753

Fredrik Olsson <peylow@gmail.com> 2005-11-30 news:dmjkbv$31is$1@digitaldaemon.com
author thomask
date Sun, 04 Dec 2005 15:06:23 +0000
parents 4698f4070a77
children 8bc1fdc33e0b
files reporter.txt run/n/nested_function_07_A.d run/n/nested_function_07_B.d run/n/nested_function_07_C.d
diffstat 4 files changed, 87 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/reporter.txt	Sun Dec 04 14:39:06 2005 +0000
+++ b/reporter.txt	Sun Dec 04 15:06:23 2005 +0000
@@ -36,6 +36,7 @@
 ElfQT			<dethjunk@yahoo.com>
 Eugene Pelekhay		<pelekhay@gmail.com>
 Florian Sonnenberger	<nairolf@online.de>
+Fredrik Olsson		<peylow@gmail.com>
 Garett Bass		<garettbass@studiotekne.com>
 Geoff Hickey
 h3r3tic / heretic
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/n/nested_function_07_A.d	Sun Dec 04 15:06:23 2005 +0000
@@ -0,0 +1,28 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Fredrik Olsson <peylow@gmail.com>
+// @date@	2005-11-30
+// @uri@	news:dmjkbv$31is$1@digitaldaemon.com
+
+module dstress.run.n.nested_function_07_A;
+
+int outer(int a) {
+	int inner(int b) {
+		a += b;
+		if (b > 0) {
+			return inner(b - 1);
+		} else {
+			return a;
+		}
+	}
+	return inner(a);
+}
+
+int main(char[][] args) {
+	assert(outer(3) == 9);
+
+	return 0;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/n/nested_function_07_B.d	Sun Dec 04 15:06:23 2005 +0000
@@ -0,0 +1,29 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Fredrik Olsson <peylow@gmail.com>
+// @date@	2005-11-30
+// @uri@	news:dmjkbv$31is$1@digitaldaemon.com
+
+module dstress.run.n.nested_function_07_B;
+
+int outer() {
+	int a = 3;
+	int inner(int b) {
+		a += b;
+		if (b > 0) {
+			return inner(b - 1);
+		} else {
+			return a;
+		}
+	}
+	return inner(a);
+}
+
+int main(char[][] args) {
+	assert(outer() == 9);
+
+	return 0;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/n/nested_function_07_C.d	Sun Dec 04 15:06:23 2005 +0000
@@ -0,0 +1,29 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Fredrik Olsson <peylow@gmail.com>
+// @date@	2005-11-30
+// @uri@	news:dmjkbv$31is$1@digitaldaemon.com
+
+module dstress.run.n.nested_function_07_C;
+
+int outer() {
+	int a = 1;
+	
+	int inner(bool repeat) {
+		if (repeat) {
+			return inner(false);
+		} else {
+			return a;
+		}
+	}
+	return inner(true);
+}
+
+int main(char[][] args) {
+	assert(outer() == 1);
+
+	return 0;
+}
+