[ruby-talk:02538] Re: Default naming for iterator parameters

From: h.fulton@...
Date: 2000-04-20 20:15:48 UTC
List: ruby-talk #2538
Hmm. Here are my thoughts.

The parameters are "supposed" to be specified. If 
someone omits them, he is presumably purposely using
the default names -- in effect he is redeclaring those
local names -- and he should not be amazed when he gets
the innermost definition.

If he doesn't like that behavior, he can specify his
own parameter names or else rename the local variables.

But it might be worthwhile to have Ruby print a warning
about this. (?)

Hal

> 	>I thought being able to set default iterator parameter naming *might* 
> 	>be good idea.
> 
> The lazy part of my brain (which is sizable) likes the idea,
> but I'm afraid it may violate the Principle of Least Surprise.
> What would you propose if the there were already local variables
> that had the same name as the default ones?
> 
> /\ndy

In This Thread

Prev Next