Hello,
This is a summary of ruby-dev ML in these days.
---- ruby-dev #18281-18319 (2002-09-14 … 2002-09-21) ----
[ruby-dev:18285] rubicon on EWS4800
Koji Arai posted a patch to run rubicon on NEC EWS4800 workstation.
[ruby-dev:18292] escaper.rb
Akinori Musha introduced escaper.rb(*), which provides classes for
escaping strings.
(*) http://www.idaemons.org/cgi-bin/cvsweb.cgi/rb/escaper.rb
[ruby-dev:18314] class nest in module_eval
Minero Aoki noticed an unconsistency behavior(*,**) in ruby-1.7.
ruby adapts ruby_class to check if a class is defined. On the other
hand, ruby defines the class with ruby_cbase. Both of their values
are ususally the same. In module_eval, the value of ruby_class become
a receiver of module_eval and the value of ruby_cbase keeps unchanged.
He proposed that behavior for constants and one for class should be the
same. Matz agreed with him.
(*) Example 1: The class T will be redefined with a warning.
class A
class B
class T
puts "A::T = #{self.id}"
end
::A.module_eval {
class T
puts "A::B/A::T = #{self.id}"
end
}
end
end
puts “A::T = #{A:
:T.name} (#{A:
:T.id})”
(**) Example 2: Definitions in the class T in module_eval will be
added to an already defined class.
class A
class T
puts "A::T = #{self.id}"
end
class B
class T
puts "A::T = #{self.id}"
end
::A.module_eval {
class T
puts "A::B/A::T = #{self.id}"
end
}
end
end
puts "A::T = #{A::T.name} (#{A::T.id})"
puts “A::T = #{A:
:T.name} (#{A:
:T.id})”
···
–
Takaaki Tateishi ttate@kt.jaist.ac.jp