this is going to be a stream of thought, not really one coherant question.  i am sorry(or 'you are welcome', in some cases).

here's the method definition:

def test(a = 'foo', b = 'bar', *more_arz)
 #does stuff - doesn't matter
end

now, when calling this method, say i only want to change the value of b, while leaving a the same.  how can i do this?

test( , 'baz')
 #or
test(nil, 'baz')

but they don't work correctly (first one doesn't parse at all, the second sets a to nil).  i could change the order of the arguments, but that wouldn't solve the problem for the opposite case.  i can see how, with a ruby array, every entry before the last entry must have a value.  however, i am working on an extension in this case, so if there's a quick answer that involved c (maybe a c array instead of a ruby one), i would be okay with that as well.

well, on thinking about it more, that would probly involve serious modifying of lots of deep-down, important ruby stuff, so this may not be worth it at all - please tell me if this is the case.  one idea would be to make up a new kind of object, say of class IgnoredClass, the behavior of which, in an argument list, is:
- to serve as a placeholder for the defining of optional arguments.
- not to override the assignment of any arguments in it's place, should they be optional.
- to throw an error if it is in the place of a required argument.
- and therefore not to count towards the total number of arguments being passed in, in fact to throw an error unless the required number of arguments has already been met.
then name it something like 'skip', so you could say:
  test(skip, 'baz')
and have that work out.  the part i wouldn't be able to figure out myself is getting all those behaviors i listed right.  ruby internals are still very scary to me.  also, what other uses could ignored have?  (and maybe undef alread does this, i'm still not sure on it's uses)

ooo.  here is an answer i thought of that would work that's much simpler:  have a hash replace all the optional arguments, then deconstruct it once inside, giving values to those entries that don't have any.

there might still be a better answer, so i think i'll still send this out.

TIA, and once again, sorry if this is more trouble than it's worth.
martin, aka <stillflame / FaerieMUD.org>
"If you think you are too small to make a difference, try sleeping in a closed room with a mosquito..." African Proverb
___________________________________________________
GO.com Mail                                    
Get Your Free, Private E-mail at http://mail.go.com