From: Gregory Brown Date: 2007-06-24T10:21:18+09:00 Subject: Re: Named/positional method args On 6/23/07, Trans wrote: > > > On Jun 23, 6:09 pm, darren kirby wrote: > > *Sigh*, I mean: > > > > # Writes embedded images to a file > > # > > # :call-seq: > > # write_picture() -> nil > > # write_picture(:outfile=>"str") -> nil > > # write_picture(:n=>int) -> nil > > # write_picture(:outfile=>"str", :n=>int) -> nil > > > > -d > > Bingo. > > But hey, as Resident Dreamer, I can't help but wonder how cool it > might be to have highly descriptive and auto-flexible arguments: > > def write_picture(n <= Integer, outfile <= String) > ... > end > > write_picture("front cover", 1) > write_picture(1, "front cover") > > Sacrifice a little duck-typiness for some arg-flippiness :) Yuck.