diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cli/runtime/AGenerator.cs | 14 | ||||
-rw-r--r-- | src/cli/runtime/Cons.cs | 10 | ||||
-rw-r--r-- | src/cli/runtime/ISeq.cs | 20 | ||||
-rw-r--r-- | src/cli/runtime/RT.cs | 6 | ||||
-rw-r--r-- | src/org/clojure/runtime/AGenerator.java | 7 | ||||
-rw-r--r-- | src/org/clojure/runtime/Cons.java | 2 | ||||
-rw-r--r-- | src/org/clojure/runtime/ISeq.java | 19 | ||||
-rw-r--r-- | src/org/clojure/runtime/RT.java | 6 |
8 files changed, 8 insertions, 76 deletions
diff --git a/src/cli/runtime/AGenerator.cs b/src/cli/runtime/AGenerator.cs index 3c051e5c..1cd9ee9a 100644 --- a/src/cli/runtime/AGenerator.cs +++ b/src/cli/runtime/AGenerator.cs @@ -4,23 +4,11 @@ using System.Text; namespace org.clojure.runtime
{
-public abstract class AGenerator : ISeq, Iter{
+public abstract class AGenerator : Iter{
Object __val;
int __state = 0;
-
-
- #region ISeq Members
-
- public Iter iter()
- {
- //generators get 'primed' by calling iterate once, which pulls up to first yield
- return iterate();
- }
-
- #endregion
-
#region Iter Members
public object get()
diff --git a/src/cli/runtime/Cons.cs b/src/cli/runtime/Cons.cs index 117ad95d..331e3073 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,Iter,ISeq
+public class Cons : AMap,Iter
{ public Object first; @@ -42,14 +42,6 @@ public Iter iterate() #endregion
-#region ISeq Members
-
-public Iter iter()
- {
- return this;
- }
-
-#endregion
} } diff --git a/src/cli/runtime/ISeq.cs b/src/cli/runtime/ISeq.cs deleted file mode 100644 index cbde40c9..00000000 --- a/src/cli/runtime/ISeq.cs +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) Rich Hickey. All rights reserved. - * The use and distribution terms for this software are covered by the - * Common Public License 1.0 (http://opensource.org/licenses/cpl.php) - * which can be found in the file CPL.TXT at the root of this distribution. - * By using this software in any fashion, you are agreeing to be bound by - * the terms of this license. - * You must not remove this notice, or any other, from this software. - **/
-
-using System;
-
-namespace org.clojure.runtime
- {
- interface ISeq
- {
- Iter iter();
-
- }
- }
diff --git a/src/cli/runtime/RT.cs b/src/cli/runtime/RT.cs index 544cba51..2d4e2180 100644 --- a/src/cli/runtime/RT.cs +++ b/src/cli/runtime/RT.cs @@ -55,10 +55,8 @@ public class RT static public Iter iter(Object coll)
{
- if (coll == null)
- return null;
- else if (coll is ISeq)
- return ((ISeq)coll).iter();
+ if (coll == null || coll is Iter)
+ return (Iter)coll;
else if (coll is IEnumerable)
{
IEnumerator e = ((IEnumerable)coll).GetEnumerator();
diff --git a/src/org/clojure/runtime/AGenerator.java b/src/org/clojure/runtime/AGenerator.java index c6d2875d..03b35dac 100644 --- a/src/org/clojure/runtime/AGenerator.java +++ b/src/org/clojure/runtime/AGenerator.java @@ -12,7 +12,7 @@ package org.clojure.runtime; -public abstract class AGenerator implements ISeq, Iter{ +public abstract class AGenerator implements Iter{ Object __val; int __state = 0; @@ -22,9 +22,4 @@ public Object get() return __val; } -public Iter iter() - { - //generators get 'primed' by calling iterate once, which pulls up to first yield - return iterate(); - } } diff --git a/src/org/clojure/runtime/Cons.java b/src/org/clojure/runtime/Cons.java index 6d19f019..0d8de670 100644 --- a/src/org/clojure/runtime/Cons.java +++ b/src/org/clojure/runtime/Cons.java @@ -12,7 +12,7 @@ package org.clojure.runtime; -public class Cons extends AMap implements Iter, ISeq{ +public class Cons extends AMap implements Iter{ public Object first; public Cons rest; diff --git a/src/org/clojure/runtime/ISeq.java b/src/org/clojure/runtime/ISeq.java deleted file mode 100644 index e5d4c8fa..00000000 --- a/src/org/clojure/runtime/ISeq.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) Rich Hickey. All rights reserved. - * The use and distribution terms for this software are covered by the - * Common Public License 1.0 (http://opensource.org/licenses/cpl.php) - * which can be found in the file CPL.TXT at the root of this distribution. - * By using this software in any fashion, you are agreeing to be bound by - * the terms of this license. - * You must not remove this notice, or any other, from this software. - **/ - -/* rich Apr 3, 2006 */ - -package org.clojure.runtime; - -public interface ISeq{ - -public Iter iter(); - -} diff --git a/src/org/clojure/runtime/RT.java b/src/org/clojure/runtime/RT.java index ca49f32f..5548f2f9 100644 --- a/src/org/clojure/runtime/RT.java +++ b/src/org/clojure/runtime/RT.java @@ -51,10 +51,8 @@ public class RT{ static public Iter iter(Object coll) { - if(coll == null) - return null; - else if(coll instanceof ISeq) - return ((ISeq) coll).iter(); + if(coll == null || coll instanceof Iter) + return (Iter) coll; else if(coll instanceof Iterator) { Iterator i = (Iterator) coll; |