Simple question concerning overloading

Mathias Weyel wrote:

class Whatever {
  List objects;
  public void remove(Object o) {...}
  public void remove(int i) {...}
}

This makes no sense in Ruby, because Numbers are also Objects. I'd suggest naming the method .delete and .delete_at instead.

Which brings me back to a question I've asked before. In 2.0 with keyword
arguments will

delete (obj)
and
delete(at: index)

be distinguishable methods? If not, I think we will not get the full benefit
of keyword arguments. I'd be forced to use delete_at where I would prefer to
use delete:at:

Also, will the keyword parameter names be accessible via reflection?

···

"Florian Gross" <flgr@ccan.de> wrote

This makes no sense in Ruby, because Numbers are also Objects. I'd
suggest naming the method .delete and .delete_at instead.

itsme213 wrote:

Which brings me back to a question I've asked before. In 2.0 with keyword
arguments will

delete (obj)
and
delete(at: index)

be distinguishable methods? If not, I think we will not get the full benefit
of keyword arguments. I'd be forced to use delete_at where I would prefer to
use delete:at:

They will be from inside the method, I suppose. We can build real method overloading around that easily.