diff options
Diffstat (limited to 'src/cli/runtime/PersistentListIdentityMap.cs')
| -rw-r--r-- | src/cli/runtime/PersistentListIdentityMap.cs | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/src/cli/runtime/PersistentListIdentityMap.cs b/src/cli/runtime/PersistentListIdentityMap.cs index 17f0794a..330aeb5b 100644 --- a/src/cli/runtime/PersistentListIdentityMap.cs +++ b/src/cli/runtime/PersistentListIdentityMap.cs @@ -31,7 +31,7 @@ namespace org.clojure.runtime * code duplication here is kind of gross, but most efficient
*/
- public class PersistentListIdentityMap : IPersistentMap, IMapEntry
+ public class PersistentListIdentityMap : IPersistentMap, IMapEntry, ISeq, ISequential
{
static public PersistentListIdentityMap EMPTY = new PersistentListIdentityMap();
@@ -96,6 +96,21 @@ namespace org.clojure.runtime return 0;
}
+ virtual public Object first()
+ {
+ return null;
+ }
+
+ virtual public ISeq rest()
+ {
+ return null;
+ }
+
+ virtual public ISeq seq()
+ {
+ return null;
+ }
+
internal class Iter : IEnumerator
{
PersistentListIdentityMap e;
@@ -207,6 +222,21 @@ namespace org.clojure.runtime return EMPTY;
return this;
}
+
+ override public Object first()
+ {
+ return this;
+ }
+
+ override public ISeq rest()
+ {
+ return null;
+ }
+
+ override public ISeq seq()
+ {
+ return this;
+ }
}
internal class Link : PersistentListIdentityMap
@@ -289,6 +319,21 @@ namespace org.clojure.runtime return count();
}
+ override public Object first()
+ {
+ return this;
+ }
+
+ override public ISeq rest()
+ {
+ return _rest;
+ }
+
+ override public ISeq seq()
+ {
+ return this;
+ }
+
PersistentListIdentityMap create(Object k, Object v, IPersistentMap r)
{
if (r == EMPTY)
|
