Hello,
I present you a ruby-dev summary in these days.
[ruby-dev:18818] CFD: adding “condition” and so on for tracing events
Hiroshi Nakamura suggested that the following events should be
notified to the tracer, which is set by set_trace_func.
- condition
is notified at conditions.
- load-call
is notified immediately before loading a file.
- load-return
is notified immediately after loading a file.
- rescue
is notified at rescue clauses.
Matz rejected the suggestion since they will make ruby slower.
[ruby-dev:18861] class variables
Matz proposed the better specification of class variable as follows.
He welcomes advice.
(1) In a toplevel layer of a class, uninitialized class variables
is forbidden to be substituted in a method.
He thinks that we had better initialize them like constants.
(2) In a declaration of a singleton class, initializing class variables
are forbidden.
It is because class variables belong to the most inner class/module
which is not singleton.
(3) Substituting class variables outside of method definitions give a
warning. This is an early detection of the error like constants.
(4) The scope of class variables is restricted only within the class/module.
All the subclasses can not access to those class variables.
[ruby-dev:18887] String#substr?
Takaaki Tateishi proposed a method for checking if a sub-string is exactly
same as other sub-string without creating a new string object. The method
suppresses the excessive cost of creating new strings.
Matz approved the idea, however rejected its method name ‘substr?’.
[ruby-dev:18896] spec. of format “%.nx”
Kazuhisa Yanagawa asked a question about the specification of the method
’format’, since the result of “%.3x”%-10 is “…f6” whereas its precision
is 3. The specification will be changed as follows.
"%.4x"%-10 #=> fff6
"%.3x"%-10 #=> ff6
"%.2x"%-10 #=> f6
"%.1x"%-10 #=> f6
···
–
Takaaki Tateishi ttate@kt.jaist.ac.jp