From: "Ruth A. Kramer" Date: 2005-02-15T01:07:40+09:00 Subject: Re: Printing why's (poignant) guide to ruby James Britt wrote: > Navindra Umanee wrote: > > If you don't have a clue about the basics like this, you'll soon fail > > miserably whether you're using Ruby or not. And come-on, who's going > > to explain yield and blocks to a newbie? > > It wouldn't be the first, or even the second, thing I would teach, but a > newbie needs to learn them so as to stop being a newbie. > > I don't think they are as hard to explain as one might think. (Making > full use of them is much harder, but getting the essential idea and > basic syntax and semantics may be pretty straightforward). Challenge: Well, how about explaining them (or at least blocks)? If you attempt it, how about explaining blocks from the point of view of an ex-Algol, Pascal, PL/1 programmer, for whom a block is just a way of grouping several statements together so they can all be executed as a result of some "test" (like if then else, while do, etc.). Is there something extra or different about a Ruby block? What? Enquiring newbies want to know ;-) Randy Kramer