From: Ryan Leavengood Date: 2005-11-06T16:15:16+09:00 Subject: Re: Generation of Unique Symbols On 11/6/05, Eric Hofreiter wrote: > So far this is the best way I have come up with to generate unique symbols: > > symbol = :AAAAAAAA > > def getNext > symbol = eval(":" + symbol.id2name.next) > end > > But this is obviously not very efficient. Is there a better way to do this? If not I may just > go back to good old integers. There is no need for eval: irb(main):001:0> symbol = :AAAAAAAA => :AAAAAAAA irb(main):002:0> symbol.to_s.next.intern => :AAAAAAAB Ryan