Soilihi BEN SOILIHI BOINA pushed to branch add-proj at Stefan / Typer
Commits: fd27756b by Soilih BEN SOILIH at 2021-12-02T16:25:21-05:00 eval
- - - - -
1 changed file:
- src/eval.ml
Changes:
===================================== src/eval.ml ===================================== @@ -463,8 +463,16 @@ let rec eval lxp (ctx : Env.runtime_env) (trace : eval_debug_info): (value_type) (eval f ctx trace) (List.map (fun e -> eval e ctx trace) args) (* Proj *) - | Proj (l, e, i) - -> eval' e ctx + | Proj (loc, e, i) + -> let vt = eval' e ctx in + ( + match vt with + | Vcons (symbol, vtl) -> List.nth vtl i + | _ -> error + loc + "Connot find a value in position %d \n" i + ) +
(* Case *) | Case (loc, target, pat, dflt)
View it on GitLab: https://gitlab.com/monnier/typer/-/commit/fd27756b4e6d5c378c070ef5a206a4acbe...
Afficher les réponses par date