Original Post
Hi, I'm writing a lisp/scheme derived scripting engine. I'd like to implement "tail-call optimization"...but I'm not sure how to identify when a function call is a tail call. Any ideas? Also, the design of my evaluator seems to me very inefficient...the core are the mutually recursive functions evaluate(expression) and apply (function, arguments). The mutual recursion is slow and quickly eats up my stack. Is there a better (iterative) way to evaluate expressions? Thanks, Alex