On Friday 16 May 2003 03:38 am, you wrote:
> Can you explain that?  What do you mean by "don't fit"?

I find it more convenient when the scope of the method is directly readable 
from the declaration of the method. In Java, public/protected/private are 
qualifiers:

private int dontcallme();

In ruby, I need a second line to specify the scope of the method. Or the 
default scope was change before the method declaration. In both cases I have 
to look around the code to find what the scope of the method is.

With variables, the name only gives me all that information. It took me a 
little while to get used to it (I was more used to the $ used the shell way, 
to retrieve the value of the variable), I finally find it very convenient. I 
was wondering if a similar concept could work with methods.

Nevertheless, I do realize that what I proposed would break many existing 
code. I just threw the idea to see what people think of it, if there is a way 
to make it fly. If not, I can live very well with the existing mechanism :)

I also notice that the ProgrammingRuby documentation, for example, doesn't 
specify which methods are plublic, protected or private. Is the scope of 
methods not considered important in Ruby? On the other hand, changing the 
documentation doesn't need such a dramatich syntax change as the one I 
proposed :)

Guillaume.


> > What about the following syntax (for
> > Ruby 3.0 :)? The scope of the method would be known by the first
>
> caracters of
>
> > its name, the same way as the scope of a variable is determined by $, @,
>
> @@
>
> > or nothing. So:
> >
> > class Test
> >   def method1; end   # public method
> >   def _method2; end  # protected method
> >   def __method3; end # private method
> > end
>
> Err, this is merely a convention for identifiers but a change in syntax.
> Apart from the fact that it might break existing code personally I prefer
> the more elaborate version with explicitely written access modifiers.
> Also I've been told that it's not too good an idea to attach semantic to
> certain identifiers or identifier formatting.
>
> Regards
>
>     robert