Feature #3908: private constant
http://redmine.ruby-lang.org/issues/show/3908

Author: Yusuke Endoh
Status: Open, Priority: Normal
Assigned to: Yusuke Endoh, Category: core, Target version: 1.9.3

Hi,

I'd propose "private constant."
Private constant provides method-like visibility for constant.


=3D=3D=3D Sample code =3D=3D=3D

  module SomeModule
    class PublicClass
      ...
    end

    class PrivateClass
      ...
    end

    # you can make "PrivateClass" private by private_constant method
    private_constant :PrivateClass
  end

  # we can refer access constant as is conventionally done
  p SomeModule::PublicClass  #=3D> SomeModule::PublicClass

  # a RuntimeError is raised when we attempt to refer private constant
  p SomeModule::PrivateClass  #=3D> private constant (RuntimeError)

  # we can even refer private constant from its parent scope
  module SomeModule
    p PrivateClass  #=3D> SomeModule::PrivateClass
  end


=3D=3D=3D Background =3D=3D=3D

Traditionally, there is no way to prevent users from using your classes.
It is too easy for user to access any internal class (e.g., CGI::Html3,
Enumerator::Generator, Matrix::Scalar, URI::Util, etc).
We can only write a document to ask users not to use them.

RubySpec inspired me to propose this feature.  RubySpec declares the
policy that no spec should be written for private method.  Nevertheless,
there were some specs for internal classes, such as CGI::Html3 (FYI,
such specs are already deleted).
I thought this was because there is no way to explicitly declare that
the constants are "internal use only."


=3D=3D=3D Proposal =3D=3D=3D

Private constant is a scoped constant that can be referred only from
its parent scope.  It can be used for declaring "the constant is
for internal use," like private method.

When users try to refer private constant, they can realize that they
are going to use non-guaranteed feature, because the constant cannot
be referred so easily.  Even so, they can use such a feature with
self-responsibility, by explicitly opening its parent scope.

Since the default visibility is public, this feature does not break
any compatibility.


=3D=3D=3D Current status =3D=3D=3D

I first suggested this at [ruby-dev:39685].
Matz approved my proposal [ruby-dev:39686]
Yugui has also approved [ruby-dev:40254], but said that it is needed
to discuss in ruby-core list before commit.

The patches are attached.  make check and make test-rubyspec are all
passed.


What do you think?
I'll commit the patch unless there is objection.

-- =

Yusuke ENDOH <mame / tsg.ne.jp>


----------------------------------------
http://redmine.ruby-lang.org
RnJvbSBhNzkyN2NmZDUwZGJiZj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