From: Paul Brannan Date: 2005-10-20T22:38:24+09:00 Subject: Re: Method annotation and anonymous functions On Thu, Oct 20, 2005 at 09:40:21AM +0900, David A. Black wrote: > I think I'm coming from a different perspective. I haven't seen any > examples of this that make me think it's worth either incompatibility > or new punctuation. I strongly dislike the idea of having a > specification of the class of the return value (object) of a method, > since that militates against duck typing. But maybe that's just an > example. It's useful for documentation. I like that ri Array#+ tells me that + returns an array. If ri told me that it returned an object that supports the [] and []= operations, I would possibly convert the return value to an array before using it. IMO what a method expects from the user should be as minimal as possible, to make the method as reuseable as possible, but what the user can expect from a method (both what the method does and what it returns) should be very precisely specified. If the type or meaning of the return value of a method changes, there will often be an incompatibility; such changes should be made with caution. Paul