From: Markus Date: 2004-10-01T09:48:33+09:00 Subject: Re: Proc.new(method)? (was Re: Funtionality of 'case'-Expression) On Thu, 2004-09-30 at 14:12, Brian Candler wrote: > On Fri, Oct 01, 2004 at 05:13:24AM +0900, Brian Candler wrote: > > Perhaps it makes more sense in this particular example to subclass Proc, > > giving a "Proc which has an === method for use in case statements": > > Or arguably, just alias Proc#=== to Proc#call in the language core for use > in case statements, in the same way as Class#=== exists primary for use in > case statements. Foul. The case case was adduced as _an_example_ of where the new Proc functionality might be useful. The point of extensibility feature such as this is to _avoid_ having to extend the language core every time it would be useful to do whatever they do. Alice: I'd like to add this feature. Bob: Why would you want that? Alice: Well, it would be handy in case C1. Bob: Oh, good idea. We could just deal with that in the language core. So why do you want that feature again? Alice: Well, it would be handy in case C2. Bob: Yes. I see. We could add that to the language core too. But I still don't see why we need that feature. Alice: Well, it would be handy in case C3 : > It's interesting to observe that these objects we're talking about are the > same as the selector blocks you'd use in Array#find and friends. *smile* Isn't it though? -- MarkusQ