On Mon, Oct 15, 2012 at 9:49 AM, Ryan Davis <[email protected]> wrote:
>
> On Oct 15, 2012, at 00:15 , Robert Klemme <[email protected]> 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/
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected]. To unsubscribe from this group, send email
to [email protected]. For more options, visit this
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en