[bug] Inlined blocks (Number>>to:do:)

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

[bug] Inlined blocks (Number>>to:do:)

Nicolas Petton
Issue status update for
http://smalltalk.gnu.org/node/464
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/464

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    Base classes
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  nico
 Updated by:   nico
 Status:       active

The following code doesn't work as expected:

| 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: [...]




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

Re: [bug] Number>>to:do: inlining is not transparent when loop index escapes

Paolo Bonzini-3
Issue status update for
http://smalltalk.gnu.org/project/issue/464
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/464

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    Base classes
 Category:     bug reports
 Priority:     normal
-Assigned to:  Unassigned
+Assigned to:  bonzinip
 Reported by:  nico
 Updated by:   bonzinip
-Status:       active
+Status:       postponed

In order to fix this, copying blocks should be implemented.




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