summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2006-06-10 21:22:42 +0000
committerRich Hickey <richhickey@gmail.com>2006-06-10 21:22:42 +0000
commitc66573864e1cdc9ba5cbef711ce70f0137c50f02 (patch)
treed084ed678941ad70ede8d05b3df7c5ecd77879f3
parentfa698dcab12e029587f1b79f5b99cc4b1cd50a01 (diff)
added FnSeq
-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();
+}
+}