[MacRuby] #1254: method to proc error
#1254: method to proc error ----------------------------------+----------------------------------------- Reporter: al_skipp@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- There is a problem with the CSV library that prevents custom converters from working. The following snippet illustrates the problem (the code works fine with ruby 1.9): {{{ require 'csv' csv = "one, two , three" CSV.parse(csv, :converters => lambda {|s| s.strip rescue s}) do |row| p row end }}} The root of the problem is an error in the way macruby converts methods to procs. Here is a reduction. {{{ def call_block(&block) block.call end proc = lambda { puts 'hello'} method_as_proc = method(:call_block) # convert method to proc call_block(&proc) # works as expected method_as_proc.call(&proc) # block becomes nil }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1254> MacRuby <http://macruby.org/>
#1254: method to proc error ----------------------------------+----------------------------------------- Reporter: al_skipp@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.11 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.11 Comment: Should be fixed in https://github.com/MacRuby/MacRuby/commit/485e491e3579829635a2358c0848a8d0cc... -- Ticket URL: <http://www.macruby.org/trac/ticket/1254#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby