From: Run Paint Run Run Date: 2009-06-13T02:51:55+09:00 Subject: [ruby-core:23827] [Bug #1618] Kernel.catch without Arguments Bug #1618: Kernel.catch without Arguments http://redmine.ruby-lang.org/issues/show/1618 Author: Run Paint Run Run Status: Open, Priority: Normal ruby -v: ruby 1.9.2dev (2009-06-01 trunk 23614) [i686-linux] In 1.9 Kernel.catch can be called with neither a symbol nor object to catch, e.g.: catch { } In 1.8 this usage raised an ArgumentError. The test/ruby/test_system.rb file from the Ruby repository contains: def valid_syntax?(code, fname) code.force_encoding("ascii-8bit") code = code.sub(/\A(?:\s*\#.*$)*(\n)?/n) { "#$&#{"\n" if $1 && !$2}BEGIN{throw tag, :ok}\n" } catch {|tag| eval(code, binding, fname, 0)} end With the help of #rubyspec, I've reduced this down to: catch {|wtf| throw wtf} This passes an instance of Object into the block. So, assuming that this must be a feature, could the documentation be updated with an explanation, and suggestions proffered as to the purpose of this invocation? ---------------------------------------- http://redmine.ruby-lang.org