From: GOTO Kentaro Date: 2001-08-12T17:33:16+09:00 Subject: [ruby-talk:19586] Re: Why not access control for instance and class variables? From: Niklas Frykholm Subject: [ruby-talk:19582] Re: Why not access control for instance and class variables? Date: Sun, 12 Aug 2001 16:34:31 +0900 > What about using Module#private to explicitly declare private variables. > Since we already have @private it seems confusing to introduce a second > mechanism to do something similar. Module#private only prohibits explicitly-specified-receiver invocation form, e.g., "self.p" would cause NameError. On the other hand @private has never receiver because it is not a method. The meaning of `private' seems slightly different between variable and method. So, "private :@private" looks tricky, IMHO. -- Gotoken