As I finally started to really learn to decipher Ruby by reading the Pickaxe (2nd edition), I came across one example that I knew must contain a typo of some sort. I fired up
irbjust to make sure... but came away horrified:
irb(main):001:0> def a
irb(main):004:0> a = 3
A single name within a single scope that refers to two different things!
It took me quite a while to realise that in many languages (including Java which I use almost exclusively at work) this isn't so bizarre at all, because those grammars make a very clear distinction between variables on the one hand and functions/methods on the other.
It is obvious that I have quite a number of obstacles to overcome in getting used to Ruby...