comparison src/reduce.sml @ 445:dfc8c991abd0

Replace 'with' with '++'
author Adam Chlipala <adamc@hcoop.net>
date Fri, 31 Oct 2008 09:30:22 -0400
parents bd9ee9aeca2f
children ae03d09043c1
comparison
equal deleted inserted replaced
444:f45f23ae20ed 445:dfc8c991abd0
105 | EField ((ERecord xes, _), (CName x, _), _) => 105 | EField ((ERecord xes, _), (CName x, _), _) =>
106 (case List.find (fn ((CName x', _), _, _) => x' = x 106 (case List.find (fn ((CName x', _), _, _) => x' = x
107 | _ => false) xes of 107 | _ => false) xes of
108 SOME (_, e, _) => #1 e 108 SOME (_, e, _) => #1 e
109 | NONE => e) 109 | NONE => e)
110 | EWith (r as (_, loc), x, e, {rest = (CRecord (k, xts), _), field}) => 110 | EConcat (r1 as (_, loc), (CRecord (k, xts1), _), r2, (CRecord (_, xts2), _)) =>
111 let 111 let
112 fun fields (remaining, passed) = 112 fun fields (r, remaining, passed) =
113 case remaining of 113 case remaining of
114 [] => [] 114 [] => []
115 | (x, t) :: rest => 115 | (x, t) :: rest =>
116 (x, 116 (x,
117 (EField (r, x, {field = t, 117 (EField (r, x, {field = t,
118 rest = (CRecord (k, List.revAppend (passed, rest)), loc)}), loc), 118 rest = (CRecord (k, List.revAppend (passed, rest)), loc)}), loc),
119 t) :: fields (rest, (x, t) :: passed) 119 t) :: fields (r, rest, (x, t) :: passed)
120 in 120 in
121 #1 (reduceExp env (ERecord ((x, e, field) :: fields (xts, [])), loc)) 121 #1 (reduceExp env (ERecord (fields (r1, xts1, []) @ fields (r2, xts2, [])), loc))
122 end 122 end
123 | ECut (r as (_, loc), _, {rest = (CRecord (k, xts), _), ...}) => 123 | ECut (r as (_, loc), _, {rest = (CRecord (k, xts), _), ...}) =>
124 let 124 let
125 fun fields (remaining, passed) = 125 fun fields (remaining, passed) =
126 case remaining of 126 case remaining of