[MacRuby] #1413: MacRuby inconsistent compared to CRuby when using Closure Bindings

MacRuby ruby-noreply at macosforge.org
Sun Oct 30 04:29:34 PDT 2011


#1413: MacRuby inconsistent compared to CRuby when using Closure Bindings
------------------------------------+---------------------------------------
 Reporter:  seanlilmateus@…         |       Owner:  lsansonetti@…          
     Type:  defect                  |      Status:  new                    
 Priority:  blocker                 |   Milestone:  MacRuby 0.11           
Component:  MacRuby                 |    Keywords:  Proc; closures; binding
------------------------------------+---------------------------------------
 {{{
 class Context
   @@of = :class
   def self.closure
    Proc.new { @@of = :method }
   end
 end
 p eval "@@of", Context.closure.binding #=> :class
 }}}


 a closure binding that is encapsulated by a Binding object, which is
 obtained with Proc#binding on CRuby can be used to execute other code in
 the same environment with a method such as eval, but it does not work on
 MacRuby.[[BR]]
 '''MacRuby returns a NameError:'''
 ''NameError: uninitialized class variable @@of in NSObject''

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



More information about the macruby-tickets mailing list