From: Robert Klemme Date: 2008-01-31T00:12:10+09:00 Subject: Re: Proposal/RFQ: Hash#values/keys with block 2008/1/30, Dirk Traulsen : > Am 30 Jan 2008 um 4:20 hat Robert Klemme geschrieben: > > I am not sure I agree here. If you take #each or #select, these do > > not make any sense without a block so the block is certainly not fine > > tuning the method. What examples do you have in mind? > > Below I put a few examples. I'm sure if I would really dive into the > standard lib, there might be better ones, but these came to my mind. Nice list. Yes, indeed, I see what you mean. > > My soft point here is, that it somehow feels odd to combine two > > completely orthogonal things (key extraction and entry selection) in a > > single method to me. > > It does not feel orthogonal for me. This is a combination, true, but I > would not call it orthogonal. Why not? IMHO the term fits well concepts involved: "The term is used loosely to mean mutually independent or well separated." "Mutually independent; well separated;" http://dictionary.reference.com/search?q=orthogonal > In real life most tasks are combinatory. Yeah, but in software engineering the cost of combining different tasks us decreased modularity. I do not say that it should not be done - often there are good reasons, but I have seen more often than not things lumped together despite the lack of good reasons. > > > Robert, don't you think it would fit nicely in the standard lib? > > > > I would not say that it does not fit but I am not totally convinced. > > I am trying to employ public debate to find out the best solution. > > :-) > > Well, it seems it is more of a private debate. Right you are. > I'm a little > disappointed by this lack of interest. Do you think I should have > posted it to ruby-core? No, I think the place is perfectly ok because although we are talking about a core lib change motivation for it is usage. So first those who would be using the new idiom should have their say IMHO. There was a time when we had more people chiming into discussions like this. Maybe people turned away because they found the content of the list has changed in a way that it makes the list less valuable or interesting for them. Or they have a hard time finding those gems under a pile of other threads. > > Dirk, I am glad that once again there is an interesting discussion. > > Thanks for that! > > Thanks a lot for your comments. You're welcome! Kind regards robert -- use.inject do |as, often| as.you_can - without end