Wednesday, November 12, 2008


I apologize for not posting here for almost half a year now. I have started to learn ruby and I'm impressed with I have seen so far. I read the book/tutorial in it didn't take me much time since it's geared to someone learning how to program for the first time, but you get much of the syntax of the language just by reading the tutorial.

The most interesting part of the tutorial is chapter 10. Procs is nothing new, and is not unique to ruby, from a C perspective it gives the programmer much more flexibility.

I can think of many cases where passing Procs to Methods and return Procs from Methods would be useful, i.e. make a method that will return the n_th Laguerre polynomial using the Rodrigues formula. Notice we are not evaluating the n_th Laguerre polynomial at x. We are evaluating a function that will calculate the n_th polynomial at any x.