From: "David A. Black" Date: 2005-01-14T22:31:26+09:00 Subject: Re: Duck Typing and automated Conversions Hi -- On Fri, 14 Jan 2005, Ilmari Heikkinen wrote: > Hi, > > On 14.1.2005, at 12:16, Robert Klemme wrote: >> def silly_example(str.to_str, count.to_int) >> # str and count are converted like in the example above >> s = "" >> count.times { s << str } >> s >> end > > Not to argue against possible syntatic sugar, but you can already do this in > the method signature: > > def silly_example(ostr, ocount, str=ostr.to_str, count=ocount.to_int) Yes except that then someone could call it like this: silly_example("hi", 1, "hello", 2) and clobber the conversions you were doing. David -- David A. Black dblack@wobblini.net