Method synonyms in Ruby

Posted by Max on Stack Overflow See other posts from Stack Overflow or by Max
Published on 2010-03-30T23:17:05Z Indexed on 2010/03/30 23:23 UTC
Read the original article Hit count: 344

Filed under:
|

I'm familiarizing myself with Ruby and it's the first time I see synonyms for methods in the standard library. For now I've found the ones in the Enumerable module:

collect <-> map detect <-> find include <-> member etc.

Probably other modules contains synonymic methods too. Why are they there? Is it some kind of backward compatibility? Or is it a feature of the language, so the programmer can choose between different options depending on the context to make the program look like plain English?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about newbie