> Because I read some other lauguage said that recursive programming can > totally replace loop structure. > So I want to think the loop as the recursive way! here is what i know about this: if a function invokes itself and returns the result of this invocation, this is called tail recursion: def f(x) if x < 0 return true else return f(x - 1) end end the above function is not useful, but it demonstrates tail recursion. as you see on each function invocation, the program does not need to store intermediate results to compute the final result, it just returns whatever the next invocation returns. so, tail recursion is not a recursion at all! it is just a loop. well, it is a recursion ; -), but can be implemented without a stack. so the above function can be rewritten thus: def f(x) while true if x < 0 return true else x = x - 1 end end hope this helps konstantin