From: "David A. Black" Date: 2005-10-20T09:42:44+09:00 Subject: Re: Method annotation and anonymous functions Hi -- On Thu, 20 Oct 2005, Trans wrote: > > Jeff Wood wrote: >> Yes it would, but I don't see another way to do attribution of methods >> without causing compatibility issues .... do you? > > Nitro/Facets annotations system works like so: > > class X > def foo ; "foo" ; end > ann :foo, :returns => String > end > > X.ann :foo, :log => true > > X.ann.foo.returns #=> String Ugh, if I may permit myself the expression That means goodbye to things like: def meth(thing) thing[some_thing_else] end Pinning down the class of return values is similar to pinning down the class of arguments -- arguably even more duck-typing-unfriendly, since you're specifying not only what a given object has to be but, potentially, what *its* methods have to return. David -- David A. Black dblack@wobblini.net