From: "David A. Black" Date: 2005-01-15T23:28:12+09:00 Subject: Re: Duck Typing and automated Conversions Hi -- On Sat, 15 Jan 2005, itsme213 wrote: > > "David A. Black" wrote > >> How would you move this call to #join to a method signature? >> >> def meth(a) >> puts a.join(", ") >> end >> >> I think there are only two ways: >> >> 1. put the whole thing, including the ", ", into the signature >> (which I doubt anyone would advocate); > > But you need no advocating to do, even today: > def meth (a, b = a.join(",")) > b > end > > The only difference that 'b' is a variable with a default binding, which the > caller can replace. > > True? Yes -- a big difference, in my view. Mainly I meant that there's is, I think, probably not a lot of advocacy of putting arbitrarily much of a method into its signature. (Maybe I'm just old-fashioned though :-) David -- David A. Black dblack@wobblini.net