From: dblack@... Date: 2006-07-15T01:59:16+09:00 Subject: Re: About MyClass#my_method Hi -- On Sat, 15 Jul 2006, Jonas Pfenniger wrote: > On 14/07/06, dblack@wobblini.net wrote: >> > I know but other characters are used differently in various >> > circumstances. For example {} is for a hash or a block depending where >> > it is in the code. >> >> OK, then let me put it differently: repurposing comment syntax is a >> bad idea :-) I really think that comments are important enough that >> they deserve a completely unchallenged syntax. (I know about "#{}". >> I consider the quotation marks a mitigating factor: "#" wouldn't be a >> comment anyway.) > > Yeah your point is really valid :-) Nonetheless, how often do you > think that there is a def keywork, a class and right after, with no > space, a # with some comment in all the project's ruby code ? I guess > not that much. It doesn't matter. There's no time limit: comments should have their own syntactic space, forever, whether people use them for a particular purpose or not. >> > class Test end >> > def Test::LibPath; "." end >> > Test::LibPath = File.dirname(__FILE__) >> > >> > Test::LibPath would always give the dirname of __FILE__. But in that >> > case you could use Test.method(:LibPath) >> >> So you'd have to know whether there was a method of the same name... >> which I think is very fragile. > > I don't know. A method access (in contrary to method call) is already > pretty specific, plus camel cases methods are also pretty specific. If > you do something like this, you would take care isn't it ? But again, > it's just an idea. I'm pretty sure it will not be adopted but I like > to discuss about it :-) I'm not sure what you mean by "specific" -- I'm thinking of a case where I said: Something::Whatever thinking I would get a method object, but in the Something module there was a Whatever constant. I don't want to have to check all the constant and method names dynamically to find out. David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy http://www.manning.com/black => RUBY FOR RAILS (reviewed on Slashdot, 7/12/2006!) http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log dblack@wobblini.net => me