In Ruby, what\'s the difference between {} and []?
{}
[]
{} seems to be used for both code blocks and hashes.
Are []>
[]>
Note that you can define the [] method for your own classes:
class A def [](position) # do something end def @rank.[]= key, val # define the instance[a] = b method end end