summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cli/runtime/FnSeq.cs35
-rw-r--r--src/org/clojure/runtime/FnSeq.java30
2 files changed, 65 insertions, 0 deletions
diff --git a/src/cli/runtime/FnSeq.cs b/src/cli/runtime/FnSeq.cs
new file mode 100644
index 00000000..f2867820
--- /dev/null
+++ b/src/cli/runtime/FnSeq.cs
@@ -0,0 +1,35 @@
+/**
+ * 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
+{
+
+public class FnSeq : ISeq{
+
+Object _first;
+IFn restFn;
+
+public FnSeq(Object first, IFn restFn) {
+ this._first = first;
+ this.restFn = restFn;
+}
+
+public Object first() {
+ return _first;
+}
+
+public ISeq rest() {
+ return (ISeq) restFn.invoke();
+}
+}
+
+}
diff --git a/src/org/clojure/runtime/FnSeq.java b/src/org/clojure/runtime/FnSeq.java
new file mode 100644
index 00000000..84e65b48
--- /dev/null
+++ b/src/org/clojure/runtime/FnSeq.java
@@ -0,0 +1,30 @@
+/**
+ * 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.
+ **/
+
+package org.clojure.runtime;
+
+public class FnSeq implements ISeq{
+
+Object _first;
+IFn restFn;
+
+public FnSeq(Object first, IFn restFn) {
+ this._first = first;
+ this.restFn = restFn;
+}
+
+public Object first() {
+ return _first;
+}
+
+public ISeq rest() throws Exception {
+ return (ISeq) restFn.invoke();
+}
+}