From: Stephen White Date: 2001-01-07T10:27:46+09:00 Subject: [ruby-talk:8771] Re: Keyword arguments (was: Visions for 2001/1.7.x development?) On Sun, 7 Jan 2001, Charles Hixson wrote: > def gigo(foo=nil, bar) # But this doesn't specify all defaults, so > perhaps the first one would rule? > ... > end I'd be happy with a system like: def gigo(x, y, foo=10, bar=8, fred="hello", martha=[0, nil]) then being able to do: gigo(1, 2) gigo(4, 5, 11) gigo(5, 6, fred="bye") gigo(3, 2, bar=[]) The parameters remain typeless and can be over-ridden with other object types. Unfortunately, the "=" syntax in the function call conflicts with the use of '=' as an assignment operator, but it'd be really nice if there was some way of defining the syntax to allow this to happen. This seems straightforward to me, without any interpreter magic required. Does this do near enough to everything we want keyword arguments to do? -- steve@deaf.org