From: "Hal E. Fulton" Date: 2001-09-03T20:34:18+09:00 Subject: [ruby-talk:20768] Minor cgi.rb question I don't have much experience with the cgi library, but I'm wondering about something. Suppose I want to follow an H1 header with an H2 header. Fine... cgi.out do cgi.html do cgi.body do cgi.h1 { "Larger header" } + cgi.h2 { "Smaller header" } end end end This works as expected... but I'm not certain I understand the design decision that requires me to concatenate the strings so that the block will return that string value. I.e., the code says "content = yield", grabbing the result of the block... Couldn't it have been written in such a way that output would have been done as we went along, or at least collected as we went along? Then it would be the whole contents of the block that mattered, not just the return value. (After all, if I leave out the plus sign above, currently I get only a single h2 header.) What I'm asking is: Is there a good reason it behaves this way? Hal