comparison src/expl_print.sml @ 109:813e5a52063d

Remove closure conversion in favor of zany fun with modules, which also replaces 'page'
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Jul 2008 10:17:06 -0400
parents f0f59e918cac
children 541282b81454
comparison
equal deleted inserted replaced
108:f59553dc1b6a 109:813e5a52063d
90 else 90 else
91 string (#1 (E.lookupCNamed env n))) 91 string (#1 (E.lookupCNamed env n)))
92 handle E.UnboundNamed _ => string ("UNBOUND_NAMED" ^ Int.toString n)) 92 handle E.UnboundNamed _ => string ("UNBOUND_NAMED" ^ Int.toString n))
93 | CModProj (m1, ms, x) => 93 | CModProj (m1, ms, x) =>
94 let 94 let
95 val (m1x, sgn) = E.lookupStrNamed env m1 95 val m1x = #1 (E.lookupStrNamed env m1)
96 handle E.UnboundNamed _ => "UNBOUND"
96 97
97 val m1s = if !debug then 98 val m1s = if !debug then
98 m1x ^ "__" ^ Int.toString m1 99 m1x ^ "__" ^ Int.toString m1
99 else 100 else
100 m1x 101 m1x
234 else 235 else
235 box [p_exp' true env e, 236 box [p_exp' true env e,
236 string ".", 237 string ".",
237 p_con' true env c] 238 p_con' true env c]
238 | EFold _ => string "fold" 239 | EFold _ => string "fold"
240
241 | EWrite e => box [string "write(",
242 p_exp env e,
243 string ")"]
239 244
240 and p_exp env = p_exp' false env 245 and p_exp env = p_exp' false env
241 246
242 fun p_named x n = 247 fun p_named x n =
243 if !debug then 248 if !debug then
390 p_named x n, 395 p_named x n,
391 space, 396 space,
392 string ":", 397 string ":",
393 space, 398 space,
394 p_sgn env sgn] 399 p_sgn env sgn]
395 | DPage (c, e) => box [string "page", 400 | DExport (_, sgn, str) => box [string "export",
396 p_con env c, 401 space,
397 space, 402 p_str env str,
398 string "=", 403 space,
399 space, 404 string ":",
400 p_exp env e] 405 space,
406 p_sgn env sgn]
401 407
402 and p_str env (str, _) = 408 and p_str env (str, _) =
403 case str of 409 case str of
404 StrConst ds => box [string "struct", 410 StrConst ds => box [string "struct",
405 newline, 411 newline,