Hi all,
This is a summary of ruby-dev ML in these days.
-------- #17965-18021 (2002-08-09 …2002-08-16) --------
[ruby-dev:17966] Hash has default block?
TANAKA Akira has asked that there is a method to determine
whether a hash has the default block. Matz has proposed a new method
Hash#default_proc and Akira has agreed.
[ruby-dev:17970] new scope-in-state
Keiju Ishitsuka has announced his scope-in-state module.
This module allows you to restrict an effect of
"destructive" library, such as jcode.rb or mathn.rb.
# e.g.
1 / 1 # is 1 (Fixnum)
MathnScope.scope_in {
1 / 1 # is Rational(1,1)
}
1 / 1 # is 1 (Fixnum)
You can get scope-in-state library from RAA:
http://www.ruby-lang.org/en/raa-list.rhtml?name=scope-in-state
[ruby-dev:17974] optimization module
Takaaki Tateishi has announced `optimize’ module and
Matz has suggested it is worth including to the core.
see also: [ruby-talk:46661] optimization module and tail recursion
[ruby-dev:17965] inferior-ruby-mode and irb
This thread has occurred synchronizing with ruby-talk:
[ruby-talk:47113] ruby-mode / inferior ruby.
[ruby-dev:18004] allocation framework
TANAKA Akira has noted that following code causes segmentation
fault.
# pattern 1
class << Object
alias obj_allocate allocate
end
Hash.obj_allocate # calls Object.allocate for Hash
# pattern 2
class << Hash
remove_method :allocate
end
Hash.allocate # calls Object.allocate for Hash
# pattern 3
class << Object
alias obj_allocate allocate
end
class << Array
alias allocate obj_allocate
end
Array.allocate # calls Object.allocate for Array
The purpose of the allocation framework is to get an internal
structure of instances from the class (e.g. struct RObject for Object).
Currently CLASS.allocate works for it, but it is too easy to
modify class methods from Ruby programs. Result: Ruby programs
will become very weak.
Matz has said that we must reconsider allocation framework itself.
– Minero Aoki