[ruby-talk:02584] Eat prefixing _ with names?

From: mrilu <mrilu@...>
Date: 2000-04-27 00:26:13 UTC
List: ruby-talk #2584
Is there any idea to define _Foo to be as good class name as Foo? 
Maybe this could be accomplished by stripping leading _ before 
determining name applicability for class/method/constant/module/variable.

_foo = foo  # variable _foo gets value of local variable foo or return value

class _Foo
  def f
  end
end

_foo = _Foo # same as Foo if _Foo is a class name like Foo

Came up with this when tried to use some _C_code with this common, 
yet ugly, prefixing idiom. I think one should provide clean interface Foo
which calls _Foo_in_ugly_c. 

I thought to rename my C-code, but don't know am I going around a good
thing to have or just doing the Right Thing (tm).


In This Thread

Prev Next