On May 22, 2008, at 1:49 AM, Pe, Botp wrote:

> i too had this problem, and the closest i can get is to wrap the  
> constants in a module and then freeze the module.

i'm sure you're aware but:

cfp:~ > cat a.rb
(

   module Namespace
     X = 4
     Y = 2
   end

).freeze

Object.send :remove_const, :Namespace

Namespace = Module.new
Namespace::X = 2
Namespace::Y = 4

puts Namespace::Y, Namespace::X

cfp:~ > ruby a.rb
4
2



it's hard to get around the dynamic aspects of ruby (thankfully)  ;-)

a @ http://codeforpeople.com/
--
we can deny everything, except that we have the possibility of being  
better. simply reflect on that.
h.h. the 14th dalai lama