[MacRuby] #745: README.rdoc has mistake in "Enumerable#p_findall" on "lib/dispach". And p_find_all causes an error.
#745: README.rdoc has mistake in "Enumerable#p_findall" on "lib/dispach". And p_find_all causes an error. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Enumerable#p_findall is a mistake of Enumerable#p_find_all. And p_find_all causes an error when following scripts are executed. This script described in README.rdoc. {{{ $ cat p_find_all.rb require 'dispatch' (0..4).p_find_all { |i| i.odd?} # => {3, 1} }}} {{{ $ macruby p_find_all.rb /Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.2/dispatch/enumerable.rb:44:in `p_each:': undefined local variable or method `size' for 0..4:Range (NameError) from /Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.2/dispatch/enumerable.rb:85:in `p_find_all' from /Users/watson/tmp/p_find_all.rb:1:in `<main>' }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/745> MacRuby <http://macruby.org/>
#745: README.rdoc has mistake in "Enumerable#p_findall" on "lib/dispach". And p_find_all causes an error. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by watson1978@…): p_map causes a similar error. {{{ $ cat p_map.rb require 'dispatch' p (0..4).p_map { |i| 10**i } # => [1, 1000, 10, 100, 10000] }}} {{{ $ macruby p_map.rb /Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.2/dispatch/enumerable.rb:50:in `p_each_with_index:': undefined local variable or method `size' for 0..4:Range (NameError) from /Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.2/dispatch/enumerable.rb:57:in `p_map' from /Users/watson/tmp/p_map.rb:1:in `<main>' }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/745#comment:1> MacRuby <http://macruby.org/>
#745: README.rdoc has mistake in "Enumerable#p_findall" on "lib/dispach". And p_find_all causes an error. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by caius@…): As a workaround for now you can use {{{ Range#to_a }}} to convert it to an {{{ Array }}} before calling {{{ p_map }}} {{{ $ cat p_map_to_a.rb require 'dispatch' p (0..4).to_a.p_map { |i| 10**i } }}} {{{ $ macruby p_map_to_a.rb [1, 10, 100, 1000, 10000] }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/745#comment:2> MacRuby <http://macruby.org/>
#745: README.rdoc has mistake in "Enumerable#p_findall" on "lib/dispach". And p_find_all causes an error. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by watson1978@…): p_findall is written by explaining Enumerable#p_find in README.rdoc. And a execution result doesn't become it according to a explanation. {{{ $ cat p_find.rb require 'dispatch' p (0..4).p_find { |i| i.odd?} # => 1 }}} {{{ $ macruby p_find.rb nil }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/745#comment:3> MacRuby <http://macruby.org/>
#745: README.rdoc has mistake in "Enumerable#p_findall" on "lib/dispach". And p_find_all causes an error. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by watson1978@…): And a execution result of p_mapreduce doesn't become it according to a explanation. {{{ $ cat p_mapreduce.rb require 'dispatch' p (0..4).p_mapreduce([], :concat) { |i| [10**i] } # => [1, 1000, 10, 100, 10000] }}} {{{ $ macruby p_mapreduce.rb nil }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/745#comment:4> MacRuby <http://macruby.org/>
#745: README.rdoc has mistake in "Enumerable#p_findall" on "lib/dispach". And p_find_all causes an error. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by ernest.prabhakar@…): My apologies. Alas, I'm on vacation for the next week. Feel free to patch it yourself if you have time, else I'll look at it when I get back. -- Ernie P. -- Ticket URL: <http://www.macruby.org/trac/ticket/745#comment:5> MacRuby <http://macruby.org/>
#745: README.rdoc has mistake in "Enumerable#p_findall" on "lib/dispach". And p_find_all causes an error. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by watson1978@…): I have not understood whether a explanation of "Caveat: Local Variables" is correct. {{{ $ cat gcd.rb require 'dispatch' n = 0 job = Dispatch::Job.new { n += 42 } job.join p n # => 0 }}} {{{ $ macruby gcd.rb 42 }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/745#comment:6> MacRuby <http://macruby.org/>
#745: README.rdoc has mistake in "Enumerable#p_findall" on "lib/dispach". And p_find_all causes an error. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Changes (by ernest.prabhakar@…): * status: new => closed * resolution: => fixed Comment: Thanks so much. Committed r4312. -- Ticket URL: <http://www.macruby.org/trac/ticket/745#comment:7> MacRuby <http://macruby.org/>
#745: README.rdoc has mistake in "Enumerable#p_findall" on "lib/dispach". And p_find_all causes an error. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: reopened Priority: blocker | Milestone: Component: MacRuby | Resolution: Keywords: | ----------------------------------+----------------------------------------- Changes (by watson1978@…): * status: closed => reopened * resolution: fixed => Comment: In Enumerable#p_find section, p_find_all is described. please modify. -- Ticket URL: <http://www.macruby.org/trac/ticket/745#comment:8> MacRuby <http://macruby.org/>
#745: README.rdoc has mistake in "Enumerable#p_findall" on "lib/dispach". And p_find_all causes an error. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Changes (by ernest.prabhakar@…): * status: reopened => closed * resolution: => fixed Comment: Doh, sorry about that. Committed r4315 -- Ticket URL: <http://www.macruby.org/trac/ticket/745#comment:9> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby