summaryrefslogtreecommitdiff
path: root/src/cli/runtime/Cons.cs
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2006-04-03 22:39:09 +0000
committerRich Hickey <richhickey@gmail.com>2006-04-03 22:39:09 +0000
commitb46c8d81cb7815d654e5cb77fa6f26edbd1d2944 (patch)
tree6f0b7c1a76fc003cc5a3629d39f77fb4a8f35d71 /src/cli/runtime/Cons.cs
parentec6f1688589700561599e508f4813ffe11c4f065 (diff)
Added iteration support
Diffstat (limited to 'src/cli/runtime/Cons.cs')
-rw-r--r--src/cli/runtime/Cons.cs31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/cli/runtime/Cons.cs b/src/cli/runtime/Cons.cs
index eec4e475..117ad95d 100644
--- a/src/cli/runtime/Cons.cs
+++ b/src/cli/runtime/Cons.cs
@@ -15,7 +15,7 @@ using System;
namespace org.clojure.runtime
{
-public class Cons : AMap
+public class Cons : AMap,Iter,ISeq
{
public Object first;
@@ -25,8 +25,31 @@ public Cons(Object first, Cons rest)
{
this.first = first;
this.rest = rest;
- }
-
-}
+ }
+
+
+#region Iter Members
+
+public object get()
+ {
+ return first;
+ }
+
+public Iter iterate()
+ {
+ return rest;
+ }
+
+#endregion
+
+#region ISeq Members
+
+public Iter iter()
+ {
+ return this;
+ }
+
+#endregion
+ }
}