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/cm/smlfile/skel-io.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/smlfile/skel-io.sml

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

revision 459, Fri Oct 29 06:22:25 1999 UTC revision 513, Thu Dec 16 03:14:18 1999 UTC
# Line 21  Line 21 
21      structure UU = UnpickleUtil      structure UU = UnpickleUtil
22    
23      infix 3 $      infix 3 $
     infixr 4 &  
     val op & = PU.&  
     val % = PU.%  
24    
25      exception Format = UU.Format      exception Format = UU.Format
26    
# Line 31  Line 28 
28      val b2s = Byte.bytesToString      val b2s = Byte.bytesToString
29      val b2c = Byte.byteToChar      val b2c = Byte.byteToChar
30    
31      val version = "Skeleton 3\n"      val version = "Skeleton 4\n"
32    
33      fun makeset l = SS.addList (SS.empty, l)      fun makeset l = SS.addList (SS.empty, l)
34    
# Line 48  Line 45 
45    
46      fun write_decl (s, d) = let      fun write_decl (s, d) = let
47    
48            val (P, D, M) = (1, 2, 3)
49          val symbol = PSymPid.w_symbol          val symbol = PSymPid.w_symbol
50          val list = PU.w_list          val list = PU.w_list
51    
52          fun path (SP.SPATH p) = list symbol p          val op $ = PU.$ P
53            fun path (SP.SPATH p) = "p" $ [list symbol p]
54    
55          fun decl arg = let          fun decl arg = let
             val D = 1  
56              val op $ = PU.$ D              val op $ = PU.$ D
57              fun d (SK.Bind (name, def)) = "a" $ symbol name & modExp def              fun d (SK.Bind (name, def)) = "a" $ [symbol name, modExp def]
58                | d (SK.Local (x, y)) = "b" $ decl x & decl y                | d (SK.Local (x, y)) = "b" $ [decl x, decl y]
59                | d (SK.Par l) = "c" $ list decl l                | d (SK.Par l) = "c" $ [list decl l]
60                | d (SK.Seq l) = "d" $ list decl l                | d (SK.Seq l) = "d" $ [list decl l]
61                | d (SK.Open d) = "e" $ modExp d                | d (SK.Open d) = "e" $ [modExp d]
62                | d (SK.Ref s) = "f" $ list symbol (SS.listItems s)                | d (SK.Ref s) = "f" $ [list symbol (SS.listItems s)]
63          in          in
64              d arg              d arg
65          end          end
66    
67          and modExp arg = let          and modExp arg = let
             val M = 2  
68              val op $ = PU.$ M              val op $ = PU.$ M
69              fun m (SK.Var p) = "g" $ path p              fun m (SK.Var p) = "g" $ [path p]
70                | m (SK.Decl d) = "h" $ list decl d                | m (SK.Decl d) = "h" $ [list decl d]
71                | m (SK.Let (d, e)) = "i" $ list decl d & modExp e                | m (SK.Let (d, e)) = "i" $ [list decl d, modExp e]
72                | m (SK.Ign1 (e1, e2)) = "j" $ modExp e1 & modExp e2                | m (SK.Ign1 (e1, e2)) = "j" $ [modExp e1, modExp e2]
73          in          in
74              m arg              m arg
75          end          end
# Line 94  Line 91 
91          fun list m r = UU.r_list session m r          fun list m r = UU.r_list session m r
92          fun share m f = UU.share session m f          fun share m f = UU.share session m f
93    
94            val pathM = UU.mkMap ()
95          val symbolListM = UU.mkMap ()          val symbolListM = UU.mkMap ()
96          val declM = UU.mkMap ()          val declM = UU.mkMap ()
97          val declListM = UU.mkMap ()          val declListM = UU.mkMap ()
# Line 101  Line 99 
99    
100          val symbollist = list symbolListM symbol          val symbollist = list symbolListM symbol
101    
102          fun path () = SP.SPATH (symbollist ())          fun path () = let
103                fun p #"p" = SP.SPATH (symbollist ())
104                  | p _ = raise Format
105            in
106                share pathM p
107            end
108    
109          fun decl () = let          fun decl () = let
110              fun d #"a" = SK.Bind (symbol (), modExp ())              fun d #"a" = SK.Bind (symbol (), modExp ())

Legend:
Removed from v.459  
changed lines
  Added in v.513

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