summaryrefslogtreecommitdiff
path: root/src/cli/runtime/PerisistentArrayList.cs
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2006-08-05 16:44:23 +0000
committerRich Hickey <richhickey@gmail.com>2006-08-05 16:44:23 +0000
commit279dd21d4b919496c8fb54c3135f2b82cc36f5c2 (patch)
tree0216faea0823626bc0b59346b542b68f0392feb3 /src/cli/runtime/PerisistentArrayList.cs
parentda11eb9d0dd587e532470965b3c655b741d1fa5c (diff)
added cons to IPersistentCollection
Diffstat (limited to 'src/cli/runtime/PerisistentArrayList.cs')
-rw-r--r--src/cli/runtime/PerisistentArrayList.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cli/runtime/PerisistentArrayList.cs b/src/cli/runtime/PerisistentArrayList.cs
index 07e65f5e..6753f4f1 100644
--- a/src/cli/runtime/PerisistentArrayList.cs
+++ b/src/cli/runtime/PerisistentArrayList.cs
@@ -33,6 +33,10 @@ PersistentArrayList(int size, Object defaultVal, float loadFactor, int count):ba
this._count = count;
}
+public PersistentArrayList(IArray init, int initialCapacity):base(init,initialCapacity){
+ _count = Math.Min(init.count(),initialCapacity);
+}
+
override public Object nth(int i) {
if(i >= _count)
throw new IndexOutOfRangeException();
@@ -55,11 +59,7 @@ override public int count(){
return _count;
}
-public int capacity(){
- return data.master.array.Length;
-}
-
-public PersistentArrayList add(Object val) {
+override public IPersistentCollection cons(Object val) {
if(_count == data.master.array.Length) //full
{
lock(data.master){