From 02b54e5379f1f5901a70782b5990a91afe7f5930 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sat, 31 Jan 2015 10:44:58 +0900 Subject: avoid block_given? in loop method for simplicity --- mrblib/kernel.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mrblib/kernel.rb b/mrblib/kernel.rb index 476ec8e18..8c9b122f2 100644 --- a/mrblib/kernel.rb +++ b/mrblib/kernel.rb @@ -24,8 +24,8 @@ module Kernel # Calls the given block repetitively. # # ISO 15.3.1.3.29 - def loop - return to_enum :loop unless block_given? + def loop(&block) + return to_enum :loop unless block while(true) yield -- cgit v1.2.3