From: Mark Slagell Date: 2000-10-16T00:27:04+09:00 Subject: [ruby-talk:5549] Re: Some newbye question ts wrote: > > >>>>> "D" == Dave Thomas writes: > > D> iterate { ... } # 'i' is always block local > > I prefer this rather than the original proposition (1) > > Guy Decoux As Dave says, params are really placeholders; they behave as pronouns as opposed to nouns, and we all know that in everyday language, pronouns carry an assumption of local scope. To say "whenever I get a personal letter, I open it" introduces no ambiguity about "it" - we don't have to worry what the word means at other points in a larger conversation, and the sentence can be grasped and reasoned about in isolation. Removing that assurance in a programming language context, esp. with iterators ("for each thing in this set, do such and such with it"), makes it harder to be confident about unintended side effects, so that you have to keep track of what parameter names have been used when you start nesting procs. So I guess what I'm saying is that I'd encourage making block params local. On the other hand I don't have a lot of old code that it would break. If <> and || were given these different scope meanings, it would be okay too, I'd just use <> all the time. :-) Mark