How about this definition syntax (note that `=>' is just being used here
as an example):
def foo(a, b = 1, named c, named d = 2, *args, **keys)
# notice that c and d are local vars
puts a, b, c, d
end
`keys' could also include c and d. `foo' could then be called like this:
foo(1, 2, c => 3, d => 4, e => 5)
foo(1, 2, 3, 4, e => 5)
keys -> {:c => 3, :d => 4, :e => 5}
This would also solve the problem with passing on an argument list,
since named arguments would naturally appear in the `*args' array:
def foo(*args)
bar(*args)
end
foo(1, 2, a => 3, b => 4) -> args = [1, 2, 3, 4]
Only problem is that you can't make your method callable with named
arguments only.
Cheers,
Daniel