[#1094] Re: [ruby-cvs] ruby, ruby/lib: * eval.c (ev_const_defined, ev_const_get), variable.c — Dave Thomas <dave@...>

> * eval.c (rb_mod_autoload, rb_mod_autoload_p): new method;

12 messages 2003/05/29
[#1095] Re: [ruby-cvs] ruby, ruby/lib: * eval.c (ev_const_defined, ev_const_get), variable.c — nobu.nokada@... 2003/05/29

Hi,

Re: [1.8] terminated object / invalid inspect_tbl

From: ts <decoux@...>
Date: 2003-05-26 14:36:06 UTC
List: ruby-core #1081
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:

n> You're right.  I guess ruby_frame->last_class should not be a
n> T_MODULE but T_CLASS or T_ICLASS.

 Well, it work with hook (I must stop to write stupid thing :-)))


svg% cat d.rb
#!./ruby
module M
   define_hook(:initialize) do |a|
      p "M::hook #{a.inspect}"
      super 32
   end
end

module N
   include M
   define_hook(:initialize) do |a|
      p "N::hook #{a}"
      super 12
   end
end

class B
   class << self
      def allocate:hook
         p "allocate:hook"
         super
      end
   end
   include N
   def initialize(a)
      @a = a
      p "B#initialize"
   end
end

puts "======================="
p B.new(24)

class B
   class << self
      undef allocate:hook
   end
   undef initialize:hook
end

puts "======================="
p B.new(24)
svg% 

svg% d.rb
=======================
"allocate:hook"
"N::hook 24"
"M::hook 12"
"B#initialize"
#<B:0x40099088 @a=32>
=======================
"B#initialize"
#<B:0x40098f20 @a=24>
svg% 



Guy Decoux

In This Thread