From: Eric Mahurin Date: 2005-06-29T07:28:02+09:00 Subject: Re: yield does not take a block --- Jeremy Henty wrote: > In article > <20050628215637.45029.qmail@web41129.mail.yahoo.com>, Eric > Mahurin wrote: > > > What I don't like ... is that you have no control over > whether the > > block is not allowed, optional, or required. > > What's wrong with: > > def i_hate_blocks > raise "blocks suck" if block_given? > end Of course. I was exaggerating when I said you have "no control". But, that is kind-of ugly to have to do this for every method doesn't want a block (most of them). It would be better if the iterpreter checked this at call time just like it handles other args (checking the arity). As it is now, you can pass a block to just about any method that doesn't want a block and no complaint will be given. If we didn't have yield/block_given?, this could have been easily handled with the &block syntax and something like arity. I'm not suggesting to get rid of yield... I'm just ranting. __________________________________ Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html