[MacRuby] #1371: MacRuby evaluates the first method defined using define_method through #send
#1371: MacRuby evaluates the first method defined using define_method through #send ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: reduction ------------------------------------+--------------------------------------- Discovered this problem while on a crusade to eliminate string eval usage in hot cocoa: Reduction: {{{ a = Module.new a.send :define_method, :test do |value| puts 'first' end a.send :define_method, :something_else do |value| puts 'second' end }}} If you run the code, it will print 'first', but not second. If you then swap the order of the define_method calls and run it again, it will print 'second', but will not print 'first'. -- Ticket URL: <http://www.macruby.org/trac/ticket/1371> MacRuby <http://macruby.org/>
#1371: MacRuby evaluates the first method defined using define_method through #send ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: reduction ------------------------------------+--------------------------------------- Comment(by mrada@…): I should also mention that this can be worked around by creating a Proc and passing it as an argument. -- Ticket URL: <http://www.macruby.org/trac/ticket/1371#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby