From: "ara.t.howard" Date: 2008-07-22T04:31:01+09:00 Subject: Re: Thread-local global variables? On Jul 21, 2008, at 1:23 PM, Joel VanderWerf wrote: > he closest approximation is thread-locals: > > thread = Thread.current > thread[:my_var] = "value" > > (I've often thought it would be nice to have a syntax for per-thread > globals, like $_x or something.) class Module def thattr name module_eval <<-code def #{ name }() Thread.current[#{ name.to_s.inspect }] end def #{ name }=(v) Thread.current[#{ name.to_s.inspect }] = v end code end end or similar is what i use a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama