From: Hal Fulton Date: 2003-09-08T07:48:58+09:00 Subject: Re: proposal for a named parameter prefix Sean O'Dell wrote: > Jeff Mitchell wrote: > >> nobu.nokada@softhome.net wrote in message >> news:<200309071005.h87A5o4D004546@sharui.nakada.kanuma.tochigi.jp>... >> >>>> To summerize, "%" gets us two things >>>> >>>> (1) a nice signal to let everyone know a named parameter hash is >>>> there >>>> >>>> (2) the ability to mix variable-length arguments with named >>>> parameters (in a nice way) >>> >>> >>> IIRC, matz has thought ** for it. >> >> >> >> Can you give a link to this discussion? I haven't been able to find >> it on google, rubygarden, etc. > > > If it's possible, I would prefer that Ruby DOESN'T get another > #$%^-style idiosyncracy added. Why can't named parameters just go > something like this: > > def method(param1) > end > > method(:param1 = "value") > > ....and just accept parameters as normal, except when the first named > parameter is encountered, assume the remaining parameters sent from a > call are out-of-order and will also be named parameters. In other > words, handle it transparently to the method, backwards-compatible with > existing code and without a new non-letter-character being used to > denote a syntax idiom. I agree with Sean. The exception would be that the last parameter can be a block as usual. Hal