From: James Britt Date: 2005-06-29T07:49:16+09:00 Subject: Re: yield does not take a block Bertram Scharpf wrote: > Hi, > > Am Mittwoch, 29. Jun 2005, 01:19:16 +0900 schrieb Yukihiro Matsumoto: > >>In message "Re: yield does not take a block" >> on Wed, 29 Jun 2005 00:49:17 +0900, James Britt writes: >> >>|> yield is a keyword to pass a value (and control) to the block attached >>|> to the method. I feel strange when I see yield passes a block to an >>|> outer block. >>| >>|Is that good strange or bad strange? >> >>I feel bad strange. Do you? > > > Logic demands to allow it. Prohibiting it would mean to > introduce an exception rule (POLS?). There's a lot to be said for consistency in a language, to avoid the complexity introduced by "This is the case, except when it's not." Ruby has fairly few of these instances, which is part of its appeal for me. It's nice to be able to layout a small set of ground rules and say that everything you can derive from them is valid. > > Anyway, the programmer should be saved from fooling himself > inventing more and more complicated constructions. Saved in what way? Languages should be designed to enable developers, not protect them from themselves. James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys