diff options
author | Rich Hickey <richhickey@gmail.com> | 2006-08-01 20:24:20 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2006-08-01 20:24:20 +0000 |
commit | df7b30a6c1dfd253d63786ed8277ab43329a11dd (patch) | |
tree | 70ea16a477be769f5867b1646ce61da4e8fbee9f /src/cli/runtime/ArraySeq.cs | |
parent | 0c422d65c6dc16d9e2887695ee5f6fa3e07fe617 (diff) |
changed max arity to 20
Diffstat (limited to 'src/cli/runtime/ArraySeq.cs')
-rw-r--r-- | src/cli/runtime/ArraySeq.cs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/cli/runtime/ArraySeq.cs b/src/cli/runtime/ArraySeq.cs index c0e450b4..bdfbc145 100644 --- a/src/cli/runtime/ArraySeq.cs +++ b/src/cli/runtime/ArraySeq.cs @@ -18,8 +18,9 @@ namespace clojure.lang public class ArraySeq : IndexedSeq{
readonly Object[] array;
readonly int i;
+ISeq _rest;
-static public ArraySeq create(Object[] array){
+static public ArraySeq create(params Object[] array){
if(array.Length == 0)
return null;
return new ArraySeq(array, 0);
@@ -28,6 +29,7 @@ static public ArraySeq create(Object[] array){ ArraySeq(Object[] array, int i){
this.array = array;
this.i = i;
+ this._rest = this;
}
public Object first() {
@@ -35,9 +37,13 @@ public Object first() { }
public ISeq rest() {
- if(i+1 < array.Length)
- return new ArraySeq(array, i + 1);
- return null;
+ if(_rest == this)
+ {
+ if(i+1 < array.Length)
+ _rest = new ArraySeq(array, i + 1);
+ _rest = null;
+ }
+ return _rest;
}
public int index(){
|