rubyhashrocket

Why does Ruby use the '=>' notation?


Where did it come from?

Why didn't they use -> or some other notation?


Solution

  • Faster interpreting. The => is not ever going to be used anywhere else, -> may be, making it quicker to decide what to do with as you parse the script.