summaryrefslogtreecommitdiff
path: root/src/cjr_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-09-02 17:31:45 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-09-02 17:31:45 -0400
commitab29ac3337d2be88ae3288652e999873be1dcf14 (patch)
treed3816565ec3c8518bb73979bd5957e8d324375f9 /src/cjr_print.sml
parent5885d66bebeece6ba2f7b6a1b11f719086423114 (diff)
Compiling a parametrized query the inefficient way
Diffstat (limited to 'src/cjr_print.sml')
-rw-r--r--src/cjr_print.sml11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml
index 938821be..50098a99 100644
--- a/src/cjr_print.sml
+++ b/src/cjr_print.sml
@@ -881,7 +881,7 @@ fun p_file env (ds, ps) =
case ek of
Core.Link => fields
| Core.Action =>
- case List.last ts of
+ case List.nth (ts, length ts - 2) of
(TRecord i, _) =>
let
val xts = E.lookupStruct env i
@@ -1222,12 +1222,12 @@ fun p_file env (ds, ps) =
case ek of
Core.Link => (ts, string "", string "")
| Core.Action =>
- case List.last ts of
+ case List.nth (ts, length ts - 2) of
(TRecord i, _) =>
let
val xts = E.lookupStruct env i
in
- (List.drop (ts, 1),
+ (List.take (ts, length ts - 2),
box [box (map (fn (x, t) => box [p_typ env t,
space,
string "lw_input_",
@@ -1324,10 +1324,9 @@ fun p_file env (ds, ps) =
p_list_sep (box [string ",", space])
(fn x => x)
(string "ctx"
- :: ListUtil.mapi (fn (i, _) => string ("arg" ^ Int.toString i)) ts
- @ [string "lw_unit_v"]),
+ :: ListUtil.mapi (fn (i, _) => string ("arg" ^ Int.toString i)) ts),
inputsVar,
- string ");",
+ string ", lw_unit_v);",
newline,
string "return;",
newline,