From: Tom Sawyer Date: 2002-09-17T02:48:39+09:00 Subject: Re: private variables a private instance variable is one that is not inheritable. is that the only difference? using _@, or anyhting like that is pretty ugly. it would also make me want to use _ in front of all my local variables, which take me back to my old idea of using % for regular locals: then all variables would have a puncutation mark in front of them. $ - global @@ - class @ - instance %@ - local instance % - local but % smacks of code breakage, unless it were optional. what about using parentheticals instead? since currently it is pointless to write: (@local). this may be a better notation. just a thought. -tom On Mon, 2002-09-16 at 10:51, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: private variables" > on 02/09/17, James F.Hranicky writes: > > |Are we dead set against "attr_private" ? > | > | class Foo > | attr_private :bar > | end > | > |? > > I'm not going to choose attr_private (unless someone put some idea in > my brain), because > > a) we need static information about class local instance variable at > compile time. Dynamic attr_priate at run time is too late. > > b) if we choose attr_private (by making it a syntax), we need to > search for declaration to distinguish whether a instance variable > is class local or not. I don't feel it's a Ruby Way (tm). > > matz. > -- tom sawyer, aka transami transami@transami.net