Skip to content

Commit

Permalink
[lazy] more returns Sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
richhickey committed Feb 3, 2009
1 parent 096500d commit 443ebe5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/jvm/clojure/lang/ASeq.java
Expand Up @@ -110,7 +110,7 @@ public ISeq cons(Object o){
return new Cons(o, this);
}

public Seqable more(){
public Sequence more(){
ISeq s = rest();
if(s == null)
return PersistentList.EMPTY;
Expand Down
8 changes: 4 additions & 4 deletions src/jvm/clojure/lang/Cons.java
Expand Up @@ -15,15 +15,15 @@
public class Cons extends ASeq{

private final Object _first;
private final Seqable _more;
private final Sequence _more;

public Cons(Object first, Seqable _more){
public Cons(Object first, Sequence _more){
this._first = first;
this._more = _more;
}


public Cons(IPersistentMap meta, Object _first, Seqable _more){
public Cons(IPersistentMap meta, Object _first, Sequence _more){
super(meta);
this._first = _first;
this._more = _more;
Expand All @@ -37,7 +37,7 @@ public ISeq rest(){
return more().seq();
}

public Seqable more(){
public Sequence more(){
if(_more == null)
return PersistentList.EMPTY;
return _more;
Expand Down
4 changes: 2 additions & 2 deletions src/jvm/clojure/lang/ISeq.java
Expand Up @@ -16,13 +16,13 @@
* ISeqs are immutable values, i.e. neither first(), nor rest() changes
* or invalidates the ISeq
*/
public interface ISeq extends IPersistentCollection, Sequential, Sequence{
public interface ISeq extends Sequence{

Object first();

ISeq rest();

Seqable more();
Sequence more();

ISeq cons(Object o);

Expand Down
2 changes: 1 addition & 1 deletion src/jvm/clojure/lang/LazySeq.java
Expand Up @@ -14,7 +14,7 @@

import java.util.*;

public class LazySeq extends AFn implements Seqable, IPersistentCollection, List, Sequential, Sequence {
public class LazySeq extends AFn implements List, Sequence {
static final ISeq DUMMY = new Cons(null, null);

private ISeq s = DUMMY;
Expand Down
6 changes: 3 additions & 3 deletions src/jvm/clojure/lang/RT.java
Expand Up @@ -544,8 +544,8 @@ static public ISeq cons(Object x, Object coll){
//ISeq y = seq(coll);
if(coll == null)
return new PersistentList(x);
else if (coll instanceof Seqable)
return new Cons(x, (Seqable) coll);
else if (coll instanceof Sequence)
return new Cons(x, (Sequence) coll);
else
return new Cons(x, seq(coll));
}
Expand Down Expand Up @@ -580,7 +580,7 @@ static public ISeq rest(Object x){
return seq.rest();
}

static public Seqable more(Object x){
static public Sequence more(Object x){
if(x instanceof ISeq)
return ((ISeq) x).more();
ISeq seq = seq(x);
Expand Down
2 changes: 1 addition & 1 deletion src/jvm/clojure/lang/Sequence.java
Expand Up @@ -12,5 +12,5 @@

package clojure.lang;

public interface Sequence {
public interface Sequence extends IPersistentCollection, Sequential{
}

0 comments on commit 443ebe5

Please sign in to comment.