On Mon, Oct 15, 2012 at 9:49 AM, Ryan Davis <ryand-ruby / zenspider.com> wrote:
>
> On Oct 15, 2012, at 00:15 , Robert Klemme <shortcutter / googlemail.com> wrote:
>
>> $ ruby -e 'module Kernel;define_method(foo) { yield 1 };end;foo {|x| p x}'
>> -e:1:in `<module:Kernel>': undefined local variable or method `foo'
>
> you meant :foo

Yes, of course.  Thanks for catching that.  Then we get

$ ruby -e 'module Kernel;define_method(:foo) { yield 1 };end;foo {|x| p x}'
-e:1:in `block in <module:Kernel>': no block given (yield) (LocalJumpError)
        from -e:1:in `<main>'

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/