[Borges-users] Transactions (Was: Borges Documentation)
Eric Hodel
drbrain at segment7.net
Sat Mar 20 00:52:50 EST 2004
Kaspar Schiess (eule at space.ch) wrote:
> Hello all,
>
> The following is rather relevant to your Borges code... 10 points if
> anyone tells me what kind of gotcha I ran into today:
>
> blocks = []
>
> for i in (1..10) do blocks[i-1] = proc do puts i end end
> blocks[0].call # > 10
>
> (1..10).each do |i| blocks[i] = br do puts i end end
> blocks[0].call # > 1
>
> Is this known behaviour ? Should I post this to ruby-talk ?
> kaspar - code philosopher
Yes, this is known, for in doesn't create its own scope.
--
Eric Hodel - drbrain at segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/borges-users/attachments/20040320/af688472/attachment.bin
More information about the Borges-users
mailing list