From: Niklas Frykholm Date: 2002-07-01T17:09:26+09:00 Subject: Re: functions need declaring before use [Daniel]: > I've noticed that functions require that they be declared before they can > be used. This came as somewhat as a blow as I orgaznie my code by putting > my main code first, and function listing at the end. Is this set in stone? > Plans to change? Reasoning? This is not likely to change. Ruby processes the file from beginning to end and evaluates calls and definitions as they are encountered. Ruby is dynamic, everything can be redefined and any other evaluation order would likely lead to confusion, incompability and other problems, in situations such as: def a puts "hi" end a() def a puts "bye" end a() If you want to keep your style, I suggest you put your main code in a main function and call it at the end of the program. def main ... end ... other functions ... main() // Niklas