From: Paul Brannan Date: 2002-02-16T00:33:23+09:00 Subject: Re: Keyword arguments (Was: File.open weirdness) On Fri, Feb 15, 2002 at 08:09:15AM +0900, Martin Man wrote: > hi all, > sorry to bother you once again with keyword arguments, but previous > example with File.open clearly shows the need for change. I've searched the > archves and checked TODO in ruby's cvs repository and found > two syntax proposals. > > func(:arg1 = xx, :arg2 = yy) > func(arg1: xx, arg2: yy) > > I like the second one more because it's less verbose, but The problem with the latter proposal is that it would either be ambiguous or make whitespace more significant than it already is, since: func(arg1 :xx, arg2 :yy) is the same as: func(arg1(:xx), arg2(:yy)) Additionally, how would we handle: func(arg1 : xx, arg2 : yy) since it is half-way in between? > IMHO (after having worked with Objective-C in the past) the above problem with > File.open et al, can not be solved by using keyword arguments as proposed > above. I'm not sure I follow your logic. It sounds like you are advocating keyword arguments, but then you say that they don't solve the problem? Why, then, would I want to use keyword arguments? Paul