From: Paul Brannan Date: 2008-09-02T22:29:39+09:00 Subject: [ruby-core:18440] Re: how to create a block with a block parameter in C? On Mon, Sep 01, 2008 at 10:16:45AM +0900, Nobuyoshi Nakada wrote: > void Init_foo() > { > VALUE cFoo = rb_define_class("Foo", rb_cObject); > rb_define_method(cFoo, "foo", foo, -1); This creates a method, not a block. The original example used rb_iterate to create a block: > > rb_iterate(dm, ID2SYM(rb_intern("foo")), foo, val); I think using define_method() in the original example confused the issue. I don't want to create a method at all. Perhaps a better question is how to do this in C: irb(main):001:0> p = proc { |&b| p b } => # irb(main):002:0> p.call { 1 + 1 } # => # Paul