From: Joel VanderWerf Date: 2001-11-04T17:00:03+09:00 Subject: [ruby-talk:24314] yield works, but no block given On the subject of 'yield called out of block': the following code gives that error and block_given? returns false, but at the same time yield manages to use the block. Is yield psychic? I'm using RUBY_VERSION==1.6.5. class A def each p block_given? yield 1; yield 2; yield 3 [4,5,6].each end end class B def each A.new.each end end B.new.each { |x| p x } ==> false 1 2 3 LocalJumpError: yield called out of block -- Joel VanderWerf California PATH, UC Berkeley mailto:vjoel@path.berkeley.edu Ph. (510) 231-9446 http://www.path.berkeley.edu FAX (510) 231-9512