[MacRuby] #1304: Block Fails to Return Value Upon Break
#1304: Block Fails to Return Value Upon Break ----------------------------+----------------------------------------------- Reporter: techzen@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------+----------------------------------------------- If I run the following under the system ruby 1.8.7: {{{ require 'find' starting_directory="/Users/developer/Desktop/Top" file_name_I_want_to_find="target_file.txt" path=Find.find(starting_directory) {|p| break p if p.include?(file_name_I_want_to_find) } puts "path = #{path}" }}} ... I get the expected output: {{{ path = /Users/developer/Desktop/Top/Lev_1-2/Lev_2.1/target_file.txt }}} However, if I run it under Macruby I get nothing, just: {{{ path = }}} I'm running MacRuby 0.10 (ruby 1.9.2) [universal-darwin10.0, x86_64] on 10.6.7 Also, Laurent Sansonetti <lsansonetti@apple.com> reports: {{{ $ ./miniruby -e "require 'find'; p Find.find('.') { break 42 }" nil $ ruby1.9 -e "require 'find'; p Find.find('.') { break 42 }" 42 }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1304> MacRuby <http://macruby.org/>
#1304: Block Fails to Return Value Upon Break ----------------------------+----------------------------------------------- Reporter: techzen@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------+----------------------------------------------- Comment(by lsansonetti@…): Here is a reduction: {{{ $ ./miniruby -e "def foo; yield; end; def bar; x=true; while x; x=false; foo { yield }; end; end; p bar { break 42 }" nil $ ruby -e "def foo; yield; end; def bar; x=true; while x; x=false; foo { yield }; end; end; p bar { break 42 }" 42 }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1304#comment:1> MacRuby <http://macruby.org/>
#1304: Block Fails to Return Value Upon Break ----------------------------+----------------------------------------------- Reporter: techzen@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------+----------------------------------------------- Comment(by martin@…): Still happening as of https://github.com/MacRuby/MacRuby/commit/8b4d3bd0129c385668b1933ec646a14591... -- Ticket URL: <http://www.macruby.org/trac/ticket/1304#comment:2> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby