From: Bulat Ziganshin Date: 2002-10-30T16:03:36+09:00 Subject: Re: method-call style (was Re: Snippet: Tiny Featureless Ruby Web Server) Hello Paul, Tuesday, October 29, 2002, 9:56:04 PM, you wrote: PB> In Ruby, attributes are method calls. However, they are a special type PB> of method call. Attributes are guaranteed to never modify the object. PB> And if the object isn't modified, then the attribute should remain the PB> same. I think the distinction is supported by the semantics of PB> attributes, if not by the language itself. attributes is just methods, automatically defined by attr_reader/... built-in methods. you can write such methods as attr_reader himself and some advanced OO libraries actually do this. it's easy: class Class def reader attr module_eval <<-END_OF_EVAL def #{attr} @#{attr} end END_OF_EVAL end end class A def initialize(x0) @x = x0 end reader "x" end a1 = A.new(23) p a1.x a2 = A.new(34) p a2.x -- Best regards, Bulat mailto:bulatz@integ.ru