changeset 300:ea94b1e43c97

Add foreach to empty list
author Michael Pavone <pavone@retrodev.com>
date Fri, 25 Jul 2014 13:43:25 -0700
parents c0561cb06ee3
children 5d24b3117aa7
files modules/list.tp
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/list.tp	Fri Jul 25 08:24:39 2014 -0700
+++ b/modules/list.tp	Fri Jul 25 13:43:25 2014 -0700
@@ -4,6 +4,7 @@
 		empty? <- { true }
 		fold:with <- :acc :fun { acc }
 		foldr:with <- :acc :fun { acc }
+		foreach <- :self fun { self }
 		map <- :fun { self }
 		| <- :val {
 			list node: val withTail: self