[ruby-dev:48244] [ruby-trunk - Bug #9727] Array#reject aborts with callcc

From: usa@...
Date: 2014-05-27 02:53:12 UTC
List: ruby-dev #48244
Issue #9727 has been updated by Usaku NAKAMURA.

Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: DONE, 2.1: R=
EQUIRED

Backported into ruby_2_0_0 at r46155.

----------------------------------------
Bug #9727: Array#reject aborts with callcc
https://bugs.ruby-lang.org/issues/9727#change-46884

* Author: Nobuyoshi Nakada
* Status: Closed
* Priority: Normal
* Assignee:=20
* Category: core
* Target version: current: 2.2.0
* ruby -v: r45560
* Backport: 2.0.0: DONE, 2.1: REQUIRED
----------------------------------------
2.0.0=E4=BB=A5=E9=99=8D=E3=81=A7=E3=80=81=E4=BB=A5=E4=B8=8B=E3=81=AE=E3=82=
=B3=E3=83=BC=E3=83=89=E3=81=8C=E7=95=B0=E5=B8=B8=E7=B5=82=E4=BA=86=E3=81=97=
=E3=81=BE=E3=81=99=E3=80=82

~~~ruby
require 'continuation'
cont =3D nil
a =3D [*1..10].reject do |i|
  callcc{|c| cont =3D c} if !cont and i =3D=3D 10
  false
end
a.unshift(:x)
cont.call if a.size < 1000
~~~




--=20
https://bugs.ruby-lang.org/

In This Thread

Prev Next