[Rubycocoa-devel 280] Re: new calling way

Back to archive index

Jonathan Paisley jp-ww****@dcs*****
Thu Jun 8 06:12:25 JST 2006


On 7 Jun 2006, at 15:36, Laurent Sansonetti wrote:

> Someone here talked me about that calling convention that Rails is
> using:
>
>    obj.foo(:key => val, :key2 => val2, ...)
>
> and suggested that RubyCocoa uses it.
>
> I believe that this convention is prettier than the current symbol-
> value-symbol-value..., and sounds more like Objective-C.

> Tell me what you think,

I must admit to rarely using either keyword form. I tend to go for  
the method_with_underscores.

However, I can see that the hash form is more readable, and certainly  
paves the way for some day when Ruby has true keyword arguments.

A sensible caching scheme would alleviate any concerns over  
inefficiency.






More information about the Rubycocoa-devel mailing list
Back to archive index