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 /smlnj-lib/trunk/Util/format-comb.sml
ViewVC logotype

Diff of /smlnj-lib/trunk/Util/format-comb.sml

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

revision 2917, Mon Nov 26 20:30:37 2007 UTC revision 2918, Thu Dec 13 19:57:04 2007 UTC
# Line 73  Line 73 
73      fun padr n = pad right n      fun padr n = pad right n
74    
75      fun glue e a fm x = e fm x a      fun glue e a fm x = e fm x a
76        fun elem gm fm x a = gm a fm x
77    
78      fun nothing fm    = fm      fun nothing fm    = fm
79      fun text s        = glue string s      fun text s        = glue string s
# Line 80  Line 81 
81      fun nl fm         = text "\n" fm      fun nl fm         = text "\n" fm
82      fun tab fm        = text "\t" fm      fun tab fm        = text "\t" fm
83    
84        fun list0g g [] = nothing
85          | list0g g [x] = g x
86          | list0g g (h :: t) = g h o text ", " o list0g g t
87    
88        fun listg g l = text "[" o list0g g l o text "]"
89    
90        fun optiong g NONE = text "NONE"
91          | optiong g (SOME a) = text "SOME(" o g a o text ")"
92    
93        fun list e = elem (listg (glue e))
94        fun option e = elem (optiong (glue e))
95    
96    end    end

Legend:
Removed from v.2917  
changed lines
  Added in v.2918

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