[#38470] ruby-dev summary 21403-21530 (draft) — Minero Aoki <aamine@...>

青木です。

25 messages 2003/10/07
[#38475] Re: ruby-dev summary 21403-21530 (draft) — maili31s@... (SugHimsi==SUGIHARA Hiroshi) 2003/10/07

すぎむし。

[#38480] Re: ruby-dev summary 21403-21530 (draft) — Minero Aoki <aamine@...> 2003/10/08

青木です。

[#38481] marshal_dump (was Re: ) — m_seki@... 2003/10/08

[#38484] Re: marshal_dump (was Re: ) — matz@... (Yukihiro Matsumoto) 2003/10/09

まつもと ゆきひろです

[#38486] Re: marshal_dump (was Re: ) — Masatoshi Seki <m_seki@...> 2003/10/09

咳といいます

[#38489] exit status on exit! — YANAGAWA Kazuhisa <kjana@...4lab.to>

<http://www.unixuser.org/~ysjj/diary/?200310a&to=200310082#200310082>

29 messages 2003/10/09
[#38490] Re: exit status on exit! — Koji Arai <JCA02266@...> 2003/10/09

新井です。

[#38503] Re: exit status on exit! — YANAGAWA Kazuhisa <kjana@...4lab.to> 2003/10/10

In Message-Id: <20031010.082218.74733862.JCA02266@nifty.ne.jp>

[#38505] Re: exit status on exit! — Koji Arai <JCA02266@...> 2003/10/10

新井です。

[#38507] Re: exit status on exit! — matz@... (Yukihiro Matsumoto) 2003/10/11

まつもと ゆきひろです

[#38514] Re: exit status on exit! — YANAGAWA Kazuhisa <kjana@...4lab.to> 2003/10/11

In Message-Id: <1065883639.405037.23137.nullmailer@picachu.netlab.jp>

[#38515] Re: exit status on exit! — WATANABE Hirofumi <eban@...> 2003/10/11

わたなべです。

[ruby-list:38527] ruby-dev summary 21531-21607 (draft)

From: Kazuo Saito <ksaito@...>
Date: 2003-10-13 07:48:17 UTC
List: ruby-list #38527
斉藤です。

今週分の ruby-dev summary です。

一応、ruby-list の方むけに、サマライズのルールを挙げておきます。

(1)bug修正のみのスレッドは基本的に外す。
   大きな仕様変更などで流しておきたい、意見が欲しい、などの
   リクエストがあれば入れる。
(2)結論が確定してなければ次回に回しても可(私だけ?:-)。
   今回 autoload の問い合わせは抜きました。
(3)土曜か日曜に draft を出す。月曜か火曜くらいには
   ruby-talkへ。ruby-devの全記事網羅よりは週刊を厳守。
(4)流せる記事が少なければ、次週に持ち越し。

です。というわけで、一日遅れててすみませんが、添削お願いします。
今回は休日出勤中にコソコソ書いてる(笑)ので間違いの指摘が
多いかもしれません。水曜には出したい、です。

=begin

[ruby-dev:21531] O_ACCMODE

 Tanaka Akira added a constant Fcntl::O_ACCMODE defined in POSIX fcntl.h to 
ext/fcntl module.


[ruby-dev:21538] rb_frame_last_func for alias method

 In the method added alias, rb_frame_last_func() returns
 the ID for the alias name in 1.8.0 release.  In 1.6.0,
 this returns the ID for the original name.

 Kazuhiro Yoshida asked how to get original name ID and
 Matz recommended to include "env.h" and get the ID from
 ruby_frame->orig_func.


[ruby-dev:21543] Enumerator

 From request for adding Enumerator to latest CVS tree by Akinori MUSHA,  
Koji Arai and him discuss when
 and how to add new libraries into Ruby main tree. The
 libraries are in rough/ directory separately.

 At this time they have the same opinion that it will
 be a good help for both library developers and users to
 bundle it with main development(unstable) CVS tree early.
 Arai said that the library will have an opportunity for
 appeal, evaluation and refinement, but it should already
 has reasonable maturity for compilation and execution.

 MUSHA also mentioned the library developer should also provide backward 
compatibility, such as API compatibility and stand-alone distribution of 
the library for old Ruby versions.


[ruby-dev:21590] extend with marshal_dump/marshal_load

 NAKAMURA, Hiroshi and Matz talked about keeping 'extend' information of 
marshaled object.  It is
 ignored by default. When users define original marshal_dump and 
marshal_load, they are responsible
 for supporting the information by themselves.
 Matz showed us an example how to dump and load such objects
 correctly in [ruby-dev:21593].  In following example, objects
 of class Quux can be dumped and loaded.  Notice that class Foo
 and Bar does not needed to concern about marshaling 'extend' info.

 This example is already applied some patches by NaHi in
 [ruby-dev:21595] to original one:


----
class Foo
  def initialize
    @data_a = 1
    @r, @w = IO.pipe
  end
  def marshal_dump
    @data_a
  end
  def marshal_load(obj)
    @data_a = obj
    @r, @w = IO.pipe
  end
end

class Bar < Foo
  def initialize
    super
    @data_b = 2
  end
  def marshal_dump
    [super, @data_b]
  end
  def marshal_load(data)
    super(data[0])
    @data_b = data[1]
  end
end

module ExtendMarshal
  def marshal_dump
    base_data = super
    extends = (class << self; self; end).ancestors - self.class.ancestors - 
[ExtendMarshal]
    data = {:modules => extends, :base => base_data}
    extends.each do |m|
      m.instance_method(:marshal_dump_extend).bind(self).call(data)
    end
    data
  end
  def marshal_load(data)
    extends = data[:modules]
    extends.reverse_each do |m|
      self.extend(m)
      m.instance_method(:marshal_load_extend).bind(self).call(data)
    end
    super(data[:base])
  end
end

module Baz
  include ExtendMarshal
  def marshal_dump_extend(data)
    data[:Baz] = 42
  end
  def marshal_load_extend(data)
    @baz_data = data[:Baz]
  end
end

class Quux<Bar
  include ExtendMarshal
end
o1 = Quux.new
o1.extend(Baz)
o2 = Marshal.load(Marshal.dump(o1))
p o1
p o2

  =end

-- 
Kazuo Saito <ksaito@uranus.dti.ne.jp>

In This Thread

Prev Next