From: Wayne Vucenic Date: 2006-12-26T02:57:35+09:00 Subject: Re: Help with a ruby idiom Hi Devin, On 12/23/06, Devin Mullins wrote: > (Though, I tend to use the ||= idiom most often with instance/class > variables, who don't raise NameError like locals do.) Not to be picky, but class variables do raise NameError: C:\>ruby -e "puts @@a" -e:1: uninitialized class variable @@a in Object (NameError) C:\>ruby -v ruby 1.8.2 (2004-12-25) [i386-mswin32] Personally, the way I remember this is that if there's an even number of prefix characters before the variable name (like a or @@a) it raises NameError, but if there's an odd number (like @a or $a), it doesn't. Merry Christmas! Wayne --- Wayne Vucenic No Bugs Software Ruby, C# and Erlang Agile Contract Programming in Silicon Valley