From: Rich Kilmer Date: 2001-10-24T17:24:49+09:00 Subject: [ruby-talk:23156] Re: Bruce Eckel's opinion of Ruby > -----Original Message----- > From: Emiliano [mailto:emile@iris-advies.com] > Sent: Wednesday, October 24, 2001 4:17 AM > To: ruby-talk ML > Subject: [ruby-talk:23155] Re: Bruce Eckel's opinion of Ruby > > > Rich Kilmer wrote: > > > > But it still wouldn't be the default behaviour. Having class-private > > > data available publicly by default isn't correct in my book. You have > > > to choose what to make part of your public interface. IMO, of course. > > > > In the following I am not trying to be anti-Python...just > trying to set the record straight... > > > > Regarding "private" class variables. > > > > So...in Python you can use this: > > > > obj.__dict__['attrName']=value > > > > ...to get direct access to (get/set) the values of every > attribute on an object. > > But reading this it is immediately clear to me you are violating the > 'contract' the class provides. And in Ruby: obj.instance_eval("@attrName=value") Would also be immediately clear :-)