May 14, 2006

ruby.lesson.5

iterators are very smart which I know  from C++ for ex. so

how to use them in Ruby?
how to make them in Ruby?

iterators are used with a block. for example if I want to sum all elements in the table, I can use the iterator each, which goes through every element in the array, and add [...]