From: Dave Thomas Date: 2003-04-09T21:56:10+09:00 Subject: Patch for UnboundMethod in define_method Attached is a trivial patch to allow UnboundMethods as a parameters to define_method. Cheers Dave Index: ChangeLog =================================================================== RCS file: /src/ruby/ChangeLog,v retrieving revision 1.1617 diff -u -r1.1617 ChangeLog --- ChangeLog 9 Apr 2003 08:27:01 -0000 1.1617 +++ ChangeLog 9 Apr 2003 12:51:20 -0000 @@ -1,3 +1,7 @@ +2003-04-09 Dave Thomas + + * eval.c (rb_mod_define_method): All UnboundMethod as parameter. + Wed Apr 9 17:24:21 2003 Yukihiro Matsumoto * gc.c (rb_gc_mark_children): introduce this function again; this Index: eval.c =================================================================== RCS file: /src/ruby/eval.c,v retrieving revision 1.423 diff -u -r1.423 eval.c --- eval.c 9 Apr 2003 06:44:33 -0000 1.423 +++ eval.c 9 Apr 2003 12:51:35 -0000 @@ -7361,7 +7361,9 @@ else if (argc == 2) { id = rb_to_id(argv[0]); body = argv[1]; - if (!rb_obj_is_kind_of(body, rb_cMethod) && !rb_obj_is_proc(body)) { + if (!(rb_obj_is_kind_of(body, rb_cMethod) || + rb_obj_is_kind_of(body, rb_cUnboundMethod) || + rb_obj_is_proc(body))) { rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc/Method)", rb_obj_classname(body)); }