[MacRuby] #1412: MacRuby inconsistent compared to CRuby when using Closures Block-Local Variables
MacRuby
ruby-noreply at macosforge.org
Sun Oct 30 04:17:46 PDT 2011
#1412: MacRuby inconsistent compared to CRuby when using Closures Block-Local
Variables
------------------------------------+---------------------------------------
Reporter: seanlilmateus@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone: MacRuby 0.11
Component: MacRuby | Keywords: Proc; closures; block-local variables
------------------------------------+---------------------------------------
the following code should work like on CRuby:[[BR]]
{{{
v = :out
1.times do |;v| # Define `v` block-local
v = :in
p [v]
end #=> [:in]
# `v` should preserve its value from before the block
v #=> :out
}}}
[[BR]]
`v` should preserve its value from before the block, but it changes its
value on MacRuby
--
Ticket URL: <http://www.macruby.org/trac/ticket/1412>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list