William Djaja Tjokroaminata wrote:
> 
> Well, I am proposing 2 alternatives that I think is more consistent with
> the rest of Ruby.
> 
> 1) The use of the keyword "private"
> Any methods defined after this keyword is private.  So probably we can
> make any new instance variables created after this keyword to be also
> private.  But mixing the private and non-private variables will be
> confusing.

I'd prefer having something explicit like:
  private_variables :some, :privvy, :vars, :listed, :here
making @some, @privvy, @vars, @listed and @here private in that class.

And who knows, perhaps there is some magic tricks to be learned if
privateness can be dynamic and delayed. (I.e. define class, methods and
make instances, then pull a class_eval { private_variables :somevar })


> 2) The use of a new symbol.
> Ruby is to some extent influenced by Perl, and in Perl "$", "@", and
> "%" are used to denote the type of variables.  Ruby has used "$" and
> "@" for special meaning for variables, so this suggests to use "%" prefix
> for private variables.

IIRC, neither of $ or @ are used as operators, but % is modulus in Ruby.
I can't think of any case where it would not be backwards compatible,
but I think it looks confusing: 
	a = b%c  # b modulus c
	a = b %c # call method b with one argument; private variable c
But then, perhaps we have enough training dealing with this confusion
due to things like a +5 versus a+5...

Now, earlier when the talk of local variables came up, I noticed the ?
sign sitting to the left of the $ on my keyboard. The pound sign almost
looks like a L too! (L for local. ) Or maybe even ?, which looks like to
S's (supersecret perhaps). Don't take these ideas too serious though. I
do not prefer to program in ASCII art. :-)
  
-- 
(\[ Kent Dahl ]/)_    _~_    __[ http://www.stud.ntnu.no/~kentda/ ]___/~
 ))\_student_/((  \__d L b__/  NTNU - graduate engineering - 5. year  )
( \__\_?|?_/__/ ) _)Industrial economics and technological management(
 \____/_?_\____/ (____engineering.discipline_=_Computer::Technology___)