[MacRuby-devel] [MacRuby] #764: Weird instance variable value of C extension.

MacRuby ruby-noreply at macosforge.org
Mon Jun 28 21:42:00 PDT 2010


#764: Weird instance variable value of C extension.
--------------------------------+-------------------------------------------
 Reporter:  chekenan@…          |       Owner:  lsansonetti@…        
     Type:  defect              |      Status:  new                  
 Priority:  blocker             |   Milestone:  MacRuby 0.6          
Component:  MacRuby             |    Keywords:  extension            
--------------------------------+-------------------------------------------
 When expanding a class defined in a C extension, the new instance
 variables have strange default values (correct value should be nil).

 Try execute following code in a ruby file (if input and run in macirb, the
 output is correct).

 {{{
   require 'bigdecimal'

   class BigDecimal
      def should_be_nil
          p @one
          p @two
          p @three
          p @four
          p @five
          p @six
          p @seven
      end
   end

   BigDecimal.new('0').should_be_nil
 }}}

 In my dev environment (SL10.6.4, MacRuby 0.6), the output is:

 {{{
 #<BigDecimal:2000f23c0,'0.0',4(8)>
 true
 0
 1073741824
 false
 false
 false
 }}}
 --

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/764>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list