From: gabriele renzi Date: 2004-04-23T22:44:03+09:00 Subject: Re: should method() returns singletons ? il Fri, 23 Apr 2004 14:45:18 +0200, "Robert Klemme" ha scritto:: > >We had this discussion some weeks ago, when someone else posted a quite >similar question (method as hash key). AFAIR Matz wanted to consider >changing #hash and #eql so Method instances can be reasonably used as hash >keys. this makes sense, but is not what I need. I wanted to add stuff to a method object (namely a is_a_test_method? method), and be able to access the same method later and check if it has that property (if it responds to is_a_test_method?) Note that I needed it just for some little playing (copying the examples from the article at onjava.com about annotations in java 1.5) so I won't bother if I can't have it :) >Singletons might have some drawbacks that he does not want to pay the >price for. The major issue is that they have to be stored somewhere and >thus take up mem even when they are no longer used. Making Method hash >key compatible is completely sufficient IMHO. > Yes I see what you mean. thanks for the answer.