Hi Kai, 2009/7/2 Kai <poki...@gmail.com>: > @Rick > > I got fairly far into this before I had problems with stack overflows. > I found out later than I needed knowledge of trampoline and mutual > recursion to solve the issue. I think the approach still has potential > but the setback forced me to consider other options. This lead me to > implement the stack local in the recursive definition of parse-code.
Thanks for your comprehensive answer. I've read about mutually-recursive functions but never really known where these issues might occur in the wild outside of Stuart's discussion of trampolines in Programming Clojure. As I wrote my previous email I began to suspect by the liberal recur's that this was the case (it's amazing the amount of times through writing an email asking a question about some code you stumble upon the solution), though I'm really glad you've cleared this up for me. Is it fair to say that you've made a trade off here? i.e. it seems you're trading off the costs associated with having a large function definition against the less widely understood techniques of mutual recursion and trampolining? If so I'm inclined to agree that this is a fair trade off, particularly because of the rhythmic nature of the code and of course the fact that by using recur you're codifying a guarantee to your readers that you're tail calling. I am now curious as to whether or not this program would be clearer with trampolines. Thanks again for sharing and enlightening us with your discussion! R. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---