From: Trans Date: 2006-07-16T01:10:05+09:00 Subject: Re: About MyClass#my_method dblack@wobblini.net wrote: > 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. But I would think this would be sufficient in the cases of capitalized methods: Something::Whatever() Personaly I find the whole notation Class#method pretty poor since it can't be used in the langauge itself. I mean, I've gotten used to it, but that doesn't change the fact. And if comments are a problem with implementation then maybe we should have a better notation. But that means a seachange and so when you way the options, I think requiring a space before an in line comment isn;t so bad --after all were about to require a space for hash symbol key notation with symbol values. T.