anchor.diff:  
   You can try this out by putting the `@tailrec` annotation on the first and the latest version of even that we've defined.
   
  -## Trampolines
  +== Trampolines
   
   Another way of solving the problem of consuming too much stack space, is by moving the computation from the stack to the heap.
   
  
positive.code:   }
  ----
  
  ## Recursion and Trampolines in Scala
  
  
  Here our even and odd functions don't return domain specific values, but a general value that indicates whether the computation is done, or whether more steps are needed. The latter includes the next step as a by-name parameter, that the tail recursive runner function can call.
  
negative.code: :published_at: 2016-07-15
  :hp-tags: scala, recursion, fp
  
  ![](https://raw.githubusercontent.com/pepite/hubpress.io/gh-pages/images/ordinateur-de-bureau-pc.jpg)
  
  Recursion is beautiful. As an example, let's consider this perfectly acceptable example of defining the functions `even` and `odd` in Scala, whose semantics you can guess:
  
  