From: Minero Aoki Date: 2003-10-09T06:40:41+09:00 Subject: ruby-dev summary 21403-21530 Hi all, This is a summary of ruby-dev ML in these days. [ruby-dev:21416] return value of #warn In current 1.8, #warn returns its argument. U.Nakamura reported that #warn returns undetermined value on -W0. The return value was fixed to nil. [ruby-dev:21176] marshalling ivtbl of Time In old 1.8, ruby did not dump instance variables if #_dump or #marshal_dump is defined. Almost all built-in classes do not have #_dump/#marshal_dump, except the Time class (it has #_dump). So instance variables of Time objects will not be dumped. e.g. % ruby -ve ' t = Time.now t.instance_eval { @ivar = 3 } Marshal.load(Marshal.dump(t)).instance_eval { p @ivar } ' ruby 1.8.0 (2003-08-10) [i686-linux] # != 1.8.0 release (2003-08-04) -e:3: warning: instance variable @ivar not initialized nil Matz decided to dump/restore instance variables automatically, even if #_dump/#marshal_dump is defined. But it causes needless errors when trying to dump objects which include unserializable objects, e.g. IO. Then if an object has #_dump/#marshal_dump and meets unserializable objects, ruby will not raise exception, just ignore it. See following example for changes. % cat marshal_io class C def initialize @io = STDIN @n = 99 end def marshal_dump 3 end def marshal_load( obj ) @io = STDIN end end c = C.new p c p Marshal.load(Marshal.dump(c)) % ruby-1.8.0 marshal_io #, @n=99> #> # @n is not restored % ruby-HEAD marshal_io #> #> [ruby-dev:21498] {test,lib}/ChangeLog? Now ChangeLog file contains ruby's whole changes, including test/*, lib/*, ext/*, etc. But there are other schemes of logging, e.g. one file per one directory. NAKAMURA Hiroshi asked what our scheme should be; where to log for test scripts, for example. Matz replied that he prefers one ChangeLog file. [ruby-dev:21508] eval BEGIN/END at runtime NAKAMURA Hiroshi asked how appropriate is current BEGIN/END block behavior. See following script: eval 'BEGIN { puts "begin" } END { puts "end" }' puts '----' Ruby prints "begin", "----", then "end". So, when we execute BEGIN/END in eval, BEGIN block is executed at the beginning of eval, END block is executed at the end of ruby process. Matz replied that this is a feature. -- Minero Aoki