Skip to content
Snippets Groups Projects
Commit 24f58dc1 authored by Régis Blanc's avatar Régis Blanc
Browse files

just adding tuples in the evaluator

parent fc4c6b9f
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,14 @@ object Evaluator {
throw RuntimeErrorEx("No value for identifier " + id.name + " in context.")
}
}
case Tuple(ts) => {
val tsRec = ts.map(rec(ctx, _))
Tuple(tsRec)
}
case TupleSelect(t, i) => {
val Tuple(rs) = rec(ctx, t)
rs(i-1)
}
case Let(i,e,b) => {
val first = rec(ctx, e)
rec(ctx + ((i -> first)), b)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment