# HG changeset patch # User Adam Chlipala # Date 1215695456 14400 # Node ID dcc5dda1645c970b836c77a49f5e98ae8b4a7582 # Parent 713e01fd792413e9b7cce7365656bd241c3786b7 Fill in more types during closure conversion diff -r 713e01fd7924 -r dcc5dda1645c src/cloconv.sml --- a/src/cloconv.sml Thu Jul 03 18:11:14 2008 -0400 +++ b/src/cloconv.sml Thu Jul 10 09:10:56 2008 -0400 @@ -140,6 +140,8 @@ val ns = List.filter (fn n => n <> 0) ns val D = Ds.leave D + val envT = (L'.TRecord (map (fn n => ("fv" ^ Int.toString n, #2 (E.lookupERel env (n-1)))) ns), loc) + (*val () = Print.preface ("Before", FlatPrint.p_exp FlatEnv.basis e) val () = List.app (fn (x, t) => preface ("Bound", box [string x, space, @@ -153,11 +155,11 @@ subExpInExp (n, (L'.EField ((L'.ERel 1, loc), "fv" ^ Int.toString n), loc)) e) e ns (*val () = Print.preface (" After", FlatPrint.p_exp FlatEnv.basis body)*) - val body = (L'.ELet ([("env", (L'.TTop, loc), (L'.EField ((L'.ERel 0, loc), "env"), loc)), - ("arg", (L'.TTop, loc), (L'.EField ((L'.ERel 1, loc), "arg"), loc))], + val body = (L'.ELet ([("env", envT, (L'.EField ((L'.ERel 0, loc), "env"), loc)), + ("arg", dom, (L'.EField ((L'.ERel 1, loc), "arg"), loc))], body), loc) - val envT = (L'.TRecord (map (fn n => ("fv" ^ Int.toString n, #2 (E.lookupERel env (n-1)))) ns), loc) + val (D, fi) = Ds.func D (x, (L'.TRecord [("env", envT), ("arg", dom)], loc), ran, body) in ((L'.ERecord [("code", (L'.ECode fi, loc), (L'.TTop, loc)), diff -r 713e01fd7924 -r dcc5dda1645c tests/html_fn.lac --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/html_fn.lac Thu Jul 10 09:10:56 2008 -0400 @@ -0,0 +1,9 @@ +val main = fn () => + + Hello World! + + + + Hello World! + +