diff options
author | Rich Hickey <richhickey@gmail.com> | 2006-05-31 19:40:11 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2006-05-31 19:40:11 +0000 |
commit | 00d88b349cff1b49b8026add38bb62407232ce31 (patch) | |
tree | 1ca8c18e7f898cb2fbec507e14493a6265ae6e09 /src/cli | |
parent | aaf41d731cc4baa7693cae8d09814a00cd0e6255 (diff) |
added has(), made keys comparable
Diffstat (limited to 'src/cli')
-rw-r--r-- | src/cli/runtime/Obj.cs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/cli/runtime/Obj.cs b/src/cli/runtime/Obj.cs index 7058ebe3..9a165e67 100644 --- a/src/cli/runtime/Obj.cs +++ b/src/cli/runtime/Obj.cs @@ -20,9 +20,9 @@ public class Obj { HybridDictionary attrs; -public static int INITIAL_SIZE = 7; - -public Object put(Keyword key, Object val) +public static int INITIAL_SIZE = 7;
+
+public Object put(IComparable key, Object val) { if(attrs == null) attrs = new HybridDictionary(INITIAL_SIZE); @@ -30,11 +30,18 @@ public Object put(Keyword key, Object val) return val; }
-public Object get(Keyword key) +public Object get(IComparable key) { if(attrs == null) return null; return attrs[key]; - } + }
+
+public bool has(IComparable key)
+ {
+ if (attrs == null)
+ return false;
+ return attrs.Contains(key);
+ } } }
\ No newline at end of file |