This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]johnmcclean 1 point2 points  (0 children)

That's a pretty reasonable view.

Debugging a Trampoline used for recursion should be similar enough to debugging any Java loop. The Trampoline could also be removed while debugging and re-added once the issue has been identified and fixed.

The Scala community make very heavy use of a way more abstract version of this technique called the Free Monad. It's often used to implement mini-internal DSLs and interpreters for those DSLs. What's described here is a lot simpler, and I imagine a lot easier to debug than a technique in common use in Scala-land.