diff options
| author | Rich Hickey <richhickey@gmail.com> | 2006-07-04 18:18:35 +0000 |
|---|---|---|
| committer | Rich Hickey <richhickey@gmail.com> | 2006-07-04 18:18:35 +0000 |
| commit | 299745acaf1cf2671c30915a2f6ac9a3fc8fca49 (patch) | |
| tree | 6e5259511b01f3c3ce06fdbd067ac43311edf48c /src/cli | |
| parent | 45928ffe7f2b9e59633fb7931f2a3c75c9d6589f (diff) | |
made Obj attrs write-once
Diffstat (limited to 'src/cli')
| -rw-r--r-- | src/cli/runtime/Obj.cs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/cli/runtime/Obj.cs b/src/cli/runtime/Obj.cs index 9f201cd7..d1d969c9 100644 --- a/src/cli/runtime/Obj.cs +++ b/src/cli/runtime/Obj.cs @@ -15,13 +15,13 @@ using System; namespace clojure.lang
{ -public class Obj : IObj
-{ +public class Obj{ + volatile IPersistentMap _attrs = PersistentArrayIdentityMap.EMPTY;
-public Object putAttr( Object key, Object val)
+public Object addAttr( Object key, Object val)
{
- _attrs = _attrs.put(key, val);
+ _attrs = _attrs.add(key, val);
return val;
}
@@ -38,10 +38,6 @@ public bool hasAttr( Object key){ public IPersistentMap attrs() {
return _attrs;
}
-
-public void removeAttr(Object key) {
- _attrs = _attrs.remove(key);
-} } |
