From: Eric Hodel Date: 2006-07-16T04:02:43+09:00 Subject: Re: Preferred monkeypatching technique On Jul 15, 2006, at 9:37 AM, ara.t.howard@noaa.gov wrote: > On Sat, 15 Jul 2006, Daniel Martin wrote: >> Okay, but now if two different files include this exact code, you're >> re-generating the same symbols. This is why I used ||=, making your >> code: >> >> class Symbol >> @gensym_count ||= 0 >> def Symbol.gensym >> ("__gensym__%X" % @gensym_count += 1).intern >> end >> end >> >> At the very least, two people using the same exact code to define >> gensym shouldn't collide with each other. > > if two different files have this exact same code inlined the > programmer should be shot. if two different files require a third > that contains this code then there will be no problem. Indeed, but I think you're being too kind. -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com