[#41918] [Feature #3647] Array#sample(n, replace=false) — Kenta Murata <redmine@...>

Feature #3647: Array#sample(n, replace=false)

11 messages 2010/08/03

[#41966] [Bug #3673] PTY.getpty with IO.pipe doesn't finish on FreeBSD — Yui NARUSE <redmine@...>

Bug #3673: PTY.getpty with IO.pipe doesn't finish on FreeBSD

9 messages 2010/08/10

[#41969] [Feature #3675] String#prepend, String#>> — Sora Harakami <redmine@...>

Feature #3675: String#prepend, String#>>

15 messages 2010/08/10
[#41976] Re: [Feature #3675] String#prepend, String#>> — Yukihiro Matsumoto <matz@...> 2010/08/10

まつもと ゆきひろです

[#41974] Re: [ruby-cvs:36157] Ruby:r28955 (trunk): * complex.c (nucomp_to_[ifr]): don't allow complex with in-exact — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

7 messages 2010/08/10

[#42003] WEBrickに関するセキュリティ修正 (CVE-2010-0541) — Hideki Yamane <henrich@...>

12 messages 2010/08/11

[#42090] Math::atan2(0, 0) on ruby 1.9.2 — KUBO Takehiro <kubo@...>

久保です。

18 messages 2010/08/22
[#42092] Re: Math::atan2(0, 0) on ruby 1.9.2 — Kenta Murata <muraken@...> 2010/08/22

=1B$B$`$i$?$G$9!#=1B(B

[#42166] Ruby'sライセンスの、BSDLとのデュアルライセンスへの変更 — "NARUSE, Yui" <naruse@...>

Ruby's ライセンスは BSDL と Ruby's のデュアルライセンスになります。

14 messages 2010/08/31

[ruby-dev:41909] Re: [Feature #3627] catchのブロックを再実行するメソッド

From: Nobuyoshi Nakada <nobu@...>
Date: 2010-08-01 09:05:16 UTC
List: ruby-dev #41909
なかだです。

At Sat, 31 Jul 2010 19:06:51 +0900,
KISHIMOTO, Makoto wrote in [ruby-dev:41906]:
> loop のブロックが引数を取るようにして、
> loop {|tag|
>  ...
>  continue tag
>  ...
> }
>
> というかたちではどうでしょうか?

こんなのではどうでしょうか。


class Loop
  def loop
  begin
    t, val = catch(self) {
      yield self
      false
    }
  end while t
  val
  end
  def next(*values)
    Kernel.throw(self, [true, values])
  end
  def break(*values)
    Kernel.throw(self, [false, values])
  end
  def self.loop(&block)
    new.loop(&block)
  end
end

i = 0
Loop.loop do |tag|
  p(i += 1)
  tag.next if i < 3
  p "end"
  tag.break
end


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦


In This Thread