[MacRuby] #1413: MacRuby inconsistent compared to CRuby when using Closure Bindings
#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/>
participants (1)
-
MacRuby