2008/4/10, Hexren <me / hexren.net>: > David A. Black wrote: [...] > > A writable attribute is different from a mutable object. You can't set > > the attribute to a new object, but the read operation does expose the > > object behind the attribute -- so if that object is mutable, you can > > mutate it. > > > > And that doesnt sound strange to you ? > I see why the stuff is writable in a technical sense. > > However that is not changing my opinion: Something called "attr_reader > :foo" should not allow somebody to write to "private @foo". And it doesn't. > And if it does make something writable it should say so in the api doc and > not hope that everybody catches that fact by glancing at the example in the > doc. It doesn't make anything writable. The array was already mutable before it was assigned to @entries. This is how most OO languages behave, of those I know: Java, C#, Smalltalk, Common Lisp, Python, OCaml, D, Objective C and Groovy. Stefan