2011/1/6 Rail Shafigulin <rail.shafigulin / gmail.com>:
> i can't understand why i'm allowed to call a [] method in this manner,
> i.e. list[index], shouldn't i call it like list.[](index)

Hi Rail, welcome to ruby,

you are right. [] is a special function among a list of other (like
[]= / + - @-) that don't work regularily, so as to allow syntactic
sugar. This makes a great fit when you want to build Hash-like or
Array-like objects, just make sure not to over-use it.