From: Ivan Salazar Date: 2007-06-07T13:55:23+09:00 Subject: Re: Globals not incrementing inside block ------=_Part_43912_27795483.1181192123597 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline This one is a very common mistake when someone is new to functional languages specially when having some procedural language experience. Try looking closer at the Ruby language documentation or at any other online or book reference. Many methods in functional languages don't have side effects (don't modify the object), take this as an example: >> string = "beer" => "beer" >> string.chop => "bee" >> string => "beer" # As you see, the string value is the same >> string.chop! => "bee" >> string => "bee" #The method call with the bang (!) is the clue >> string = string.chop #Reassigning => "be" >> string #Guess what? Yes, string has a new value => "be" In brief, to modify an object you make a call to a method with side effects or reassign the object to the new one created after the method call. ------=_Part_43912_27795483.1181192123597--