[#927] UnboundMethod#to_proc — Dave Thomas <dave@...>
I'm wondering what I can do with a Proc generated by
17 messages
2003/04/06
[#929] Re: UnboundMethod#to_proc
— "Chris Pine" <nemo@...>
2003/04/06
----- Original Message -----
[#934] Re: UnboundMethod#to_proc
— Mathieu Bouchard <matju@...>
2003/04/06
[#940] Re: UnboundMethod#to_proc
— chr_news@...
2003/04/07
>
[#941] Re: UnboundMethod#to_proc
— Dave Thomas <dave@...>
2003/04/07
>> If they have diverging interfaces such that the contracts conflict
[#936] docs on implementation of ruby and/or ruby-gc ? — Ruben Vandeginste <Ruben.Vandeginste@...>
4 messages
2003/04/07
[#964] Range in logical context — Dave Thomas <dave@...>
If I run
7 messages
2003/04/16
[#965] Re: Range in logical context
— Mauricio Fern疣dez <batsman.geo@...>
2003/04/16
On Thu, Apr 17, 2003 at 06:10:40AM +0900, Dave Thomas wrote:
[#973] problem with rb_rescue2() ? — Mathieu Bouchard <matju@...>
5 messages
2003/04/19
Patch for UnboundMethod in define_method
From:
Dave Thomas <dave@...>
Date:
2003-04-09 12:56:10 UTC
List:
ruby-core #954
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 <Dave@Thomases.com>
+
+ * eval.c (rb_mod_define_method): All UnboundMethod as parameter.
+
Wed Apr 9 17:24:21 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* 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));
}