From: Jacob Fugal Date: 2005-01-25T10:19:35+09:00 Subject: Re: Refernce objects On Sat, 22 Jan 2005 22:04:53 +0900, David A. Black wrote: > On Sat, 22 Jan 2005, Jacob Fugal wrote: > > > 2) An empty parameter list is usually unnecessary, thus you can both > > define and call cached_instances without needing the '()'. Attaching > > an empty parameter list differs from no parameter list in only two > > cases I can think of; a) super vs. super() and b) disambiguating > > between a local variable and method of the same name (this may not > > even be an issue). > > You can use them that way: > > irb(main):003:0> def x; 1; end; x = 2 > => 2 > irb(main):004:0> x > => 2 > irb(main):005:0> x() > => 1 > > though just making the receiver explicit (self) is fine too. Good to know. I saw the possibility in my head but had never experienced a variable/method namespace conflict before so I didn't know what the default handling was, which is why I added the disclaimer. I'll remember which is right, now. Jacob