From: Benoit Daloze Date: 2012-10-27T05:58:12+09:00 Subject: [ruby-core:48347] Re: [ruby-trunk - Bug #7097] Thread locals don't work inside Enumerator On 26 October 2012 22:26, SASADA Koichi wrote: > (2012/10/27 5:09), Eregon (Benoit Daloze) wrote: >> Yeah, I think these examples are not particularly the best, but I see no other good name (well, #[] and #[]= but they are already taken). I'd rather remove the 'thread_' prefix from now, but it makes sense to follow instance_variable_{get,set}. > > I strongly disagree removing "thread" prefix because this method should > not be easy to use (so the name should be long name). Most of case, > `Thread#[]' is true selection. In that light, I agree thread_variable* is fine. > And I think the name "local" is too ambiguous because Ruby has "local > variables" (a variable x which is defined by `x = 1', of course you know > :)). > > For example, Ruby already has `Kernel.local_variables', which returns > names of local variables in current frame. `Thread.local_variables' (or > similar naming rule) is confusion (someone can misunderstand that this > method returns `local_variables' in thread's current context). I thought to that too. This might be less of a problem if variables referencing threads have a clear name, but it might be confusing if not. Sorry for the diversion.