Subj : [Rhino] can you add default getters/setters? To : netscape.public.mozilla.jseng From : Mike C. Date : Fri May 07 2004 05:58 am This would better go into the wishlist newsgroup ;) In ASP i can write Session("key") = "val"; And it expands to Session.Value("key", "val"); where Value is a setter of type propput (or propputref), in IDL slang. There is also a getter for Value, so you can write str = Session("key") which expands to Session.Value("key"). Would that be doable in Rhino, so I can supply a getter like Object Session.jsGetDefault_Value(String key) and a setter jsSetDefault_Value(String key, Object val) to be used by the runtime? For this particular construction, the runtime introspection would have to check first if the object (Session) is an instanceof Callable (by the way, now it checks if it is instanceof Function when encountering the call operator, is it necessary?). If it is a Callable, then the call ("key") will be applied to the object. If is not, then the runtime can look for default setters/getters and use them if a match is found. There are the ADO.Recordset - like scenarios too. For example var str = rs("field"); expanding to (written with the prefix proposed above) var str = rs.getDefault_Fields().getDefault_Item("field").getDefault_Value(); Comments? Mike .