Types of Recursion
Verfasst: 19. Jul 2013 15:49
In the sample-exam of the lecture SS11 (find it here) on page 3 Ex. 3.1 there is a question about 4 different kinds of recursion-implementation.
Well at the moment I just figured out two types:
The second type (fixpoint) is to difficult to write it down here
But what are the other two types of recursion?
Greets
K.
Well at the moment I just figured out two types:
- Usage the base languages recursion pattern --> Meta Interpreter
- Usage of FixPoints
Code: Alles auswählen
def interp(...) : ...{
...
case Rec(...) => interp(boundBody, cycBindAndInterp(boundId, namedExpr, env))
...
}
def cycBindAndInterp(...) = {
lazy val recEnv: Env = (id: Symbol) => {
if (id == boundId) interp(namedExpr, recEnv)
else env(id)
}
recEnv
}

But what are the other two types of recursion?
Greets
K.