Ruby-1.6.8-preview4 changed module_eval?

Upgrading to ruby-1.6.8-preview broke one of my apps. The culprit
was:

class Topic

SAVE_MODE = File::Constants.module_eval do WRONLY | CREAT | TRUNC end

end

… which used to work but now complains:

uninitialized constant WRONLY at Topic (NameError)

Fixing it was trivial, but I am interested to know whether this change
is deliberate?

Regards,

Jeremy Henty

Hi,

···

In message “ruby-1.6.8-preview4 changed module_eval?” on 02/12/20, Jeremy Henty jeremy@chaos.org.uk writes:

Upgrading to ruby-1.6.8-preview broke one of my apps. The culprit
was:

class Topic

SAVE_MODE = File::Constants.module_eval do WRONLY | CREAT | TRUNC end

end

… which used to work but now complains:

uninitialized constant WRONLY at Topic (NameError)

Fixing it was trivial, but I am interested to know whether this change
is deliberate?

Yes. I tried to make constants scope more static, i.e can be
determined in compile time. In the future, constat name resolution
will be done completely at compile time.

						matz.