diff options
| author | Rich Hickey <richhickey@gmail.com> | 2006-08-05 19:24:17 +0000 |
|---|---|---|
| committer | Rich Hickey <richhickey@gmail.com> | 2006-08-05 19:24:17 +0000 |
| commit | 397f768ca30a4615c753ec544dedc5c39be7743b (patch) | |
| tree | 00dd0db8e2efb38df35f942e108eab721887c457 /src/cli/runtime/ASeq.cs | |
| parent | a619d3a6f9cde068d0945ab26b275113c8ffde1b (diff) | |
added PersistentList, changed RT.cons to work with all collections
Diffstat (limited to 'src/cli/runtime/ASeq.cs')
| -rw-r--r-- | src/cli/runtime/ASeq.cs | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/cli/runtime/ASeq.cs b/src/cli/runtime/ASeq.cs index 9636e80b..18c307d6 100644 --- a/src/cli/runtime/ASeq.cs +++ b/src/cli/runtime/ASeq.cs @@ -13,25 +13,34 @@ using System; namespace clojure.lang
{
-public abstract class ASeq : ISeq{
-
-public Object peek() {
+public abstract class ASeq : Obj, ISeq{
+
+ public override Obj withMeta(IPersistentMap meta)
+ {
+ if(_meta == meta)
+ return this;
+ Obj ret = (Obj)MemberwiseClone();
+ ret._meta = meta;
+ return ret;
+ }
+
+public virtual Object peek() {
return first();
}
-public IPersistentList pop() {
+public virtual IPersistentList pop() {
return rest();
}
-public int count() {
+public virtual int count() {
return 1 + RT.count(rest());
}
-public ISeq seq() {
+public virtual ISeq seq() {
return this;
}
-public IPersistentCollection cons(Object o) {
+public virtual IPersistentCollection cons(Object o) {
return new Cons(o, this);
}
|
