One of my fellow Berkterns is teaching some of us Ruby this summer. Our first lesson included an example in which we define an array, set a variable equal to that array, and then added that variable into the array, effectively defining an infinite array (one that, in our case, repeated “dog, pony, show” over and over again).
“This is recursion,” our wise teacher announced. “If you don’t know what recursion is, Google it.”
We all dutifully followed his instructions and found this:
4 thoughts on “Learning Ruby: Recursion”
The first is Haskell, and the second is Standard ML. It’s a disease. Ruby should be first, but I’ve been bewitched.
For fun, obviously. And now I’m curious about your favorite and second-favorite languages.
Ah, and I did vote.ug in Ruby. 😀
Holy shittings! 😮
You are learning my third-favourite programming language? Coolness. Why are “Berkterns” learning Ruby?