[MacRuby] #685: inject doesn't work with Procs
#685: inject doesn't work with Procs -------------------------------------+-------------------------------------- Reporter: hghoehne@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.7 Component: MacRuby | Keywords: -------------------------------------+-------------------------------------- {{{
plus = :+.to_proc => #<Proc:0x20021a840> (1..100).inject(&plus) ArgumentError: wrong number of arguments (0 for 1) }}} or {{{ (1..100).inject(&:+) ArgumentError: wrong number of arguments (0 for 1) }}}
-- Ticket URL: <http://www.macruby.org/trac/ticket/685> MacRuby <http://macruby.org/>
#685: inject doesn't work with Procs -------------------------------------+-------------------------------------- Reporter: hghoehne@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.7 Component: MacRuby | Keywords: -------------------------------------+-------------------------------------- Comment(by martinlagardette@…): I guess this error is related to that: {{{ $> ruby19 -e 'p :+.to_proc.call(1, 2)' 3 $> macruby -e 'p :+.to_proc.call(1, 2)' /private/tmp/-e:1:in `<main>': wrong number of arguments (0 for 1) (ArgumentError) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/685#comment:1> MacRuby <http://macruby.org/>
#685: inject doesn't work with Procs -------------------------------------+-------------------------------------- Reporter: hghoehne@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.7 Component: MacRuby | Keywords: -------------------------------------+-------------------------------------- Comment(by lsansonetti@…): Currently procs created with Symbol#to_proc do not accept arguments. This is a limitation of the dispatcher, let's fix this. -- Ticket URL: <http://www.macruby.org/trac/ticket/685#comment:2> MacRuby <http://macruby.org/>
#685: inject doesn't work with Procs -------------------------------------+-------------------------------------- Reporter: hghoehne@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.7 Component: MacRuby | Resolution: fixed Keywords: | -------------------------------------+-------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed Comment: Should be fixed in r4048. {{{ $ ./miniruby -e "p :+.to_proc.call(1,2)" 3 $ ./miniruby -e "def foo(a,b,c); self+a+b+c; end; p :foo.to_proc.call(100,1,2,3)" 106 }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/685#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby