From: Adam Prescott Date: 2012-03-23T02:38:10+09:00 Subject: [ruby-core:43561] Re: [ruby-trunk - Feature #3908] private constant --e89a8ff1c2dc04b81f04bbd85f35 Content-Type: text/plain; charset=UTF-8 On Thu, Mar 22, 2012 at 17:08, trans (Thomas Sawyer) wrote: > I can't think of single reason why anyone would actually have to have a > "private", as opposed to a "public", constant. Constants are CONSTANT so > they aren't supposed to be changed after they are defined anyway --indeed > normal channels of doing so will cause a warning. And constants aren't > methods, so they aren't something you can call to effect object state. So > what's the point? You can have constants defined which are purely an implementation detail that you don't want to be public-facing, because they aren't intended to be relied upon or modified. Hiding private modules and classes aside, I can see a benefit from hiding that information. --e89a8ff1c2dc04b81f04bbd85f35 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Thu, Mar 22, 2012 at 17:08, trans (Thomas Saw= yer) <transfire= @gmail.com> wrote:
I can't think of single reason why anyone would actually have to have a= "private", as opposed to a "public", constant. Constan= ts are CONSTANT so they aren't supposed to be changed after they are de= fined anyway --indeed normal channels of doing so will cause a warning. And= constants aren't methods, so they aren't something you can call to= effect object state. So what's the point?

You can have constants defined which are purely an implement= ation detail that you don't want to be public-facing, because they aren= 't intended to be relied upon or modified. Hiding private modules and c= lasses aside, I can see a benefit from hiding that information.
--e89a8ff1c2dc04b81f04bbd85f35--