From: Paul Brannan Date: 2005-10-20T22:08:25+09:00 Subject: Re: Method annotation and anonymous functions On Thu, Oct 20, 2005 at 04:41:51AM +0900, stevetuckner wrote: > > private \ > > module_function \ > > doc("This is a docstring") \ > > def baz(a, b, c) > > # ... > > end > > > > > Aside from looking icky, how does doc() know what symbol to use to apply > the annotation with? I realize now that I should have written: private \ module_function \ doc "This is a docstring", \ def baz(a, b, c) end You are right that this is ugly (and it produces warnings). But it avoids introducting a new syntax. It's also possible to use Binding.of_caller and method_added to do method annotations. Use of such a library would look like this: private module_function doc "This is a docstring" def baz(a, b, c) end Paul