summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cli/runtime/IObj.cs10
-rw-r--r--src/cli/runtime/Keyword.cs2
-rw-r--r--src/cli/runtime/Obj.cs2
-rw-r--r--src/org/clojure/runtime/IObj.java16
-rw-r--r--src/org/clojure/runtime/Keyword.java4
-rw-r--r--src/org/clojure/runtime/Obj.java2
6 files changed, 31 insertions, 5 deletions
diff --git a/src/cli/runtime/IObj.cs b/src/cli/runtime/IObj.cs
new file mode 100644
index 00000000..3362ead2
--- /dev/null
+++ b/src/cli/runtime/IObj.cs
@@ -0,0 +1,10 @@
+using System;
+namespace org.clojure.runtime
+ {
+ interface IObj
+ {
+ object put(IComparable key, object val);
+ object get(IComparable key);
+ bool has(IComparable key);
+ }
+ }
diff --git a/src/cli/runtime/Keyword.cs b/src/cli/runtime/Keyword.cs
index f0c6a150..903d8ea4 100644
--- a/src/cli/runtime/Keyword.cs
+++ b/src/cli/runtime/Keyword.cs
@@ -24,7 +24,7 @@ internal Keyword(String name):base(name) { } public Object invoke(ThreadLocal
} /** * Indexer implements IFn for attr access * This single arg version is the getter * @param tld * @param obj - must be AMap * @return the value of the attr or nil if not found */ public Object invoke(ThreadLocalData tld, Object obj) /*throws Exception*/ {
if (obj == null)
return null;
- return ((Obj)obj).get(this); } /** * Indexer implements IFn for attr access * This two arg version is the setter * @param tld * @param obj - must be AMap * @param val * @return val */ public Object invoke(ThreadLocalData tld, Object obj, Object val) /*throws Exception*/ { return ((Obj)obj).put(this,val); }
+ return ((IObj)obj).get(this); } /** * Indexer implements IFn for attr access * This two arg version is the setter * @param tld * @param obj - must be AMap * @param val * @return val */ public Object invoke(ThreadLocalData tld, Object obj, Object val) /*throws Exception*/ { return ((IObj)obj).put(this,val); }
public Object invoke(ThreadLocalData tld, Object arg1, Object arg2, Object arg3) /*throws Exception*/
{
diff --git a/src/cli/runtime/Obj.cs b/src/cli/runtime/Obj.cs
index 9a165e67..8f73335e 100644
--- a/src/cli/runtime/Obj.cs
+++ b/src/cli/runtime/Obj.cs
@@ -16,7 +16,7 @@ using System.Collections.Specialized;
namespace org.clojure.runtime
{
-public class Obj
+public class Obj : IObj
{
HybridDictionary attrs;
diff --git a/src/org/clojure/runtime/IObj.java b/src/org/clojure/runtime/IObj.java
new file mode 100644
index 00000000..8fddcfe3
--- /dev/null
+++ b/src/org/clojure/runtime/IObj.java
@@ -0,0 +1,16 @@
+package org.clojure.runtime;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: rich
+ * Date: May 31, 2006
+ * Time: 3:41:10 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public interface IObj {
+Object put(Comparable key, Object val);
+
+Object get(Comparable key);
+
+boolean has(Comparable key);
+}
diff --git a/src/org/clojure/runtime/Keyword.java b/src/org/clojure/runtime/Keyword.java
index 8eaf7049..161e0c88 100644
--- a/src/org/clojure/runtime/Keyword.java
+++ b/src/org/clojure/runtime/Keyword.java
@@ -44,7 +44,7 @@ public Object invoke(ThreadLocalData tld, Object obj) throws Exception
{
if (obj == null)
return null;
- return ((Obj)obj).get(this);
+ return ((IObj)obj).get(this);
}
/**
@@ -58,7 +58,7 @@ public Object invoke(ThreadLocalData tld, Object obj) throws Exception
*/
public Object invoke(ThreadLocalData tld, Object obj, Object val) throws Exception
{
- return ((Obj)obj).put(this,val);
+ return ((IObj)obj).put(this,val);
}
public Object invoke(ThreadLocalData tld, Object arg1, Object arg2, Object arg3) throws Exception
diff --git a/src/org/clojure/runtime/Obj.java b/src/org/clojure/runtime/Obj.java
index 4125b298..ce71c736 100644
--- a/src/org/clojure/runtime/Obj.java
+++ b/src/org/clojure/runtime/Obj.java
@@ -14,7 +14,7 @@ package org.clojure.runtime;
import java.util.IdentityHashMap;
-public class Obj {
+public class Obj implements IObj {
IdentityHashMap attrs;
public static final int INITIAL_SIZE = 7;