From: Ilias Lazaridis Date: 2011-06-18T11:00:26+09:00 Subject: Re: CORE - Inconsistent Handling of Uninitialized Variables On 15 Ιούν, 20:49, Ilias Lazaridis wrote: [...] A simplified version, using only locals and globals def set_local(y) if false x = y end p x #=> nil #p xx #=> undefined end set_local(10) def set_global(y) if false $x = y end p $x #=> nil p global_variables.include?(:$x) #=> true p $xx #=> nil p global_variables.include?(:$xx) #=> true end set_global(10) - I understand the "set_local", and it works as expected. I don't understand, why "p $xx" does not fail with an "not defined" error. Technically, the existence of the variable is observable all over the program. I don't see the reason why "$xx" is created and set to nil, instead of throwing an "not defined" error (which I would expect when accessing an undefined var, could be e.g. a typo of me). . -- htttp://lazaridis.com