[#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
Re: UnboundMethod#to_proc
From:
Michael Granger <ged@...>
Date:
2003-04-08 13:19:45 UTC
List:
ruby-core #950
On Monday, Apr 7, 2003, at 22:40 America/Denver, Dave Thomas wrote: > On Monday, April 7, 2003, at 11:01 PM, Michael Granger wrote: >> It's also convenient when you are testing for a method object and you >> don't care whether it's bound or unbound: >> >> obj.is_a?( Method ) >> >> whereas if one weren't a generalization of the other, you'd have to >> do: >> >> obj.is_a?(Method) || obj.is_a?(UnboundMethod) >> > Except the two are really very different classes of things: are there > any reasonable circumstances in which you'd want to allow either a > Method or an UnboundMethod? In fact, this is actually an argument > against the current hierarchy, as there are times when the interpreter > allows either Proc or Method objects, but should explicitly _not_ > allow UnboundMethods. I thought I'd used Methods and UnboundMethods before in a section of code, but after going to find it again, I remember now that I encountered the problem you suggest, and have since changed it to use #send with symbols instead of Method objects. I now understand (and agree) with your point about Method vs UnboundMethod. But I still don't think #arity should be a mixin. =:) -- Michael Granger <ged@FaerieMUD.org> Rubymage/Believer/Architect The FaerieMUD Consortium