Inlined blocks

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Inlined blocks

Nicolas Petton
Hi,

Today I discovered a strange bug in Iliad. I had troubles figuring where
the bug came from, and I realized it was because of an inlined closure
(Number>>to:do:)

| c |

c := OrderedCollection new.
1 to: 10 do: [:each | c add: [each]].
c collect: [:each | each value]
-> OrderedCollection (11 11 11 11 11 11 11 11 11 11 11)

It works fine using (1 to: 10) do: [...]

In the future, I'll have to remember to avoid #to:do: with Iliad action
blocks :D

Cheers!

Nico

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Inlined blocks

Paolo Bonzini-2

> c := OrderedCollection new.
> 1 to: 10 do: [:each | c add: [each]].
> c collect: [:each | each value]
> ->  OrderedCollection (11 11 11 11 11 11 11 11 11 11 11)
>
> It works fine using (1 to: 10) do: [...]
>
> In the future, I'll have to remember to avoid #to:do: with Iliad action
> blocks :D

Yes, please report a bug.  I'll mark it as postponed immediately, but at
least we know it's there.

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Inlined blocks

Nicolas Petton
Le dimanche 24 janvier 2010 à 14:49 +0100, Paolo Bonzini a écrit :

> > c := OrderedCollection new.
> > 1 to: 10 do: [:each | c add: [each]].
> > c collect: [:each | each value]
> > ->  OrderedCollection (11 11 11 11 11 11 11 11 11 11 11)
> >
> > It works fine using (1 to: 10) do: [...]
> >
> > In the future, I'll have to remember to avoid #to:do: with Iliad action
> > blocks :D
>
> Yes, please report a bug.  I'll mark it as postponed immediately, but at
> least we know it's there.
ok :)

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment