From: mjl@... (Martin J. Laubach) Date: 2001-07-10T11:19:14+09:00 Subject: [ruby-talk:17585] Re: Constants and Variables | > One of the other things I miss dearly is a way to create a new | > block-local variable. I have been bitten by | | creating a local variable is an implicit thing that happens upon | assignment. local variable is searched in current namespace and | recursively in its parents, then if not found, is created in the current. | | block parameter passing is assignment, single or multiple. Okay, understood. Now is there a way to do block parameter passing and always create a new local variable? It's a pain moving a block around and having random pieces of code fail in mysterious ways, so I'd rather lose a bit of performance and make my blocks side-effect free. I guess this goes right down in the direction of "there should be a way to declare variables"? [1] mjl [1] And a switch telling ruby to complain when it encounters an undeclared variable. Declarings stuff is tiresome, yes, but it is useful.