From a00179b2fb6cc09f87efbe8100fb17a7dd34a920 Mon Sep 17 00:00:00 2001 From: Rich Hickey Date: Mon, 12 Jun 2006 15:01:43 +0000 Subject: renamed get,put etc to getAttr... --- src/cli/runtime/IObj.cs | 8 ++++---- src/cli/runtime/Keyword.cs | 2 +- src/cli/runtime/Obj.cs | 8 ++++---- src/cli/runtime/TObj.cs | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/cli/runtime') diff --git a/src/cli/runtime/IObj.cs b/src/cli/runtime/IObj.cs index 6e101dbb..9e8d0d93 100644 --- a/src/cli/runtime/IObj.cs +++ b/src/cli/runtime/IObj.cs @@ -13,14 +13,14 @@ namespace clojure.lang { interface IObj { - Object put(Object key, Object val); + Object putAttr(Object key, Object val); - Object get(Object key); + Object getAttr(Object key); - bool has(Object key); + bool hasAttr(Object key); IPersistentMap attrs(); - void remove(Object key); + void removeAttr(Object key); } } diff --git a/src/cli/runtime/Keyword.cs b/src/cli/runtime/Keyword.cs index 8c4f645a..34c893d6 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() /*throws } /** * 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( Object obj) /*throws Exception*/ { if (obj == null) return null; - 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( Object obj, Object val) /*throws Exception*/ { return ((IObj)obj).put(this,val); } + return ((IObj)obj).getAttr(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( Object obj, Object val) /*throws Exception*/ { return ((IObj)obj).putAttr(this,val); } public Object invoke( Object arg1, Object arg2, Object arg3) /*throws Exception*/ { diff --git a/src/cli/runtime/Obj.cs b/src/cli/runtime/Obj.cs index 32684a6b..9f201cd7 100644 --- a/src/cli/runtime/Obj.cs +++ b/src/cli/runtime/Obj.cs @@ -19,18 +19,18 @@ public class Obj : IObj { volatile IPersistentMap _attrs = PersistentArrayIdentityMap.EMPTY; -public Object put( Object key, Object val) +public Object putAttr( Object key, Object val) { _attrs = _attrs.put(key, val); return val; } -public Object get( Object key) +public Object getAttr( Object key) { return _attrs.get(key); } -public bool has( Object key){ +public bool hasAttr( Object key){ return _attrs.contains(key); } @@ -39,7 +39,7 @@ public IPersistentMap attrs() { return _attrs; } -public void remove(Object key) { +public void removeAttr(Object key) { _attrs = _attrs.remove(key); } diff --git a/src/cli/runtime/TObj.cs b/src/cli/runtime/TObj.cs index 37c38b83..5bc2e2cd 100644 --- a/src/cli/runtime/TObj.cs +++ b/src/cli/runtime/TObj.cs @@ -21,19 +21,19 @@ public TObj(){ } -public Object put( Object key, Object val) { +public Object putAttr( Object key, Object val) { IPersistentMap t = (IPersistentMap) Transaction.get( _attrs); t = t.put(key, val); Transaction.set(_attrs,t); return val; } -public Object get( Object key) { +public Object getAttr( Object key) { IPersistentMap t = (IPersistentMap) Transaction.get( _attrs); return t.get(key); } -public bool has( Object key) { +public bool hasAttr( Object key) { IPersistentMap t = (IPersistentMap) Transaction.get( _attrs); return t.contains(key); } @@ -42,7 +42,7 @@ public IPersistentMap attrs() { return (IPersistentMap) Transaction.get(_attrs); } -public void remove(Object key) { +public void removeAttr(Object key) { IPersistentMap t = (IPersistentMap) Transaction.get( _attrs); t = t.remove(key); Transaction.set(_attrs,t); -- cgit v1.2.3-70-g09d2