From: "Bartosz Dziewoński" Date: 2011-10-05T01:32:48+09:00 Subject: Re: Local vs method vs instance (was: Operator Overloading) 2011/10/4 Jesús Gabriel y Galán : > Only an assignment creates a local variable in the scope. > This is actually only 1/7th true. There are as many as 7 ways to introduce a new variable, out of which anybody would guess about 5 if they though about it for a while ;), and 2 are quite obscure. These are: 1. Single- or multiple-assignment (including sub-assignment) anywhere an expression is allowed 2. A for loop's iterator variable(s) 3. Formal arguments to a method 4. Block arguments and block-local variables 5. Stabby Lambda variables 6. Rescue exception naming (rescue StandardError => err) 7. Named Regexp captures in literal matches (/name: (?\w+)/ =~ 'name: Mike' creates a local variable named "person" with value "Mike") (The above borrowed from https://github.com/michaeledgar/ripper-plus) Ah, the joys of high-level programming :D -- Matma Rex