Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/compiler/FLINT/flint/flintutil.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/FLINT/flint/flintutil.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 216, Fri Feb 26 12:55:26 1999 UTC revision 220, Tue Mar 9 02:15:05 1999 UTC
# Line 161  Line 161 
161             FIX(nfdecs, copy nalpha le)             FIX(nfdecs, copy nalpha le)
162         end         end
163       | APP (f,args) => APP(substval f, map substval args)       | APP (f,args) => APP(substval f, map substval args)
164       | TFN ((lv,args,body),le) =>       | TFN ((tfk,lv,args,body),le) =>
165         (* don't forget to rename the tvar also *)         (* don't forget to rename the tvar also *)
166         let val (nlv,nalpha) = newv(lv,alpha)         let val (nlv,nalpha) = newv(lv,alpha)
167             val (nargs,ialpha) = newvs(map #1 args, nalpha)             val (nargs,ialpha) = newvs(map #1 args, nalpha)
168             val ita = tmap_sort ((ListPair.map             val ita = tmap_sort ((ListPair.map
169                                       (fn ((t,k),nt) => (t, LT.tcc_nvar nt))                                       (fn ((t,k),nt) => (t, LT.tcc_nvar nt))
170                                       (args, nargs)) @ ta)                                       (args, nargs)) @ ta)
171         in TFN((nlv, ListPair.zip(nargs, map #2 args), copy' ita ialpha body),         in TFN((tfk,nlv,
172                   ListPair.zip(nargs, map #2 args),
173                   copy' ita ialpha body),
174                  copy nalpha le)                  copy nalpha le)
175         end         end
176       | TAPP (f,tycs) => TAPP(substval f, map (tc_subst ta) tycs)       | TAPP (f,tycs) => TAPP(substval f, map (tc_subst ta) tycs)
# Line 235  Line 237 
237                     (loop le) fdecs),                     (loop le) fdecs),
238              map #2 fdecs)              map #2 fdecs)
239       | F.APP (f,args) => addvs(S.empty, f::args)       | F.APP (f,args) => addvs(S.empty, f::args)
240       | F.TFN ((f,args,body),le) => S.union(S.rmv(f, loop le), loop body)       | F.TFN ((tfk,f,args,body),le) => S.union(S.rmv(f, loop le), loop body)
241       | F.TAPP (f,args) => singleton f       | F.TAPP (f,args) => singleton f
242       | F.SWITCH (v,ac,arms,def) =>       | F.SWITCH (v,ac,arms,def) =>
243         let fun farm ((dc,le),fv) =         let fun farm ((dc,le),fv) =
# Line 245  Line 247 
247                             of F.DATAcon(dc,_,lv) => fdcon(S.rmv(lv, fvle),dc)                             of F.DATAcon(dc,_,lv) => fdcon(S.rmv(lv, fvle),dc)
248                              | _ => fvle)                              | _ => fvle)
249                 end                 end
250         in foldl farm (case def of NONE => S.empty | SOME le => loop le) arms             val fvs = case def of NONE => singleton v
251                                   | SOME le => addv(loop le, v)
252           in foldl farm fvs arms
253         end         end
254       | F.CON (dc,tycs,v,lv,le) => fdcon(addv(S.rmv(lv, loop le), v),dc)       | F.CON (dc,tycs,v,lv,le) => fdcon(addv(S.rmv(lv, loop le), v),dc)
255       | F.RECORD (rk,vs,lv,le) => addvs(S.rmv(lv, loop le), vs)       | F.RECORD (rk,vs,lv,le) => addvs(S.rmv(lv, loop le), vs)

Legend:
Removed from v.216  
changed lines
  Added in v.220

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0