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 2918, Thu Dec 13 19:57:04 2007 UTC revision 2919, Thu Dec 13 20:07:23 2007 UTC
# Line 81  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      fun listg' ld sep rd g l =
85        | list0g g [x] = g x          let fun loop [] = nothing
86        | list0g g (h :: t) = g h o text ", " o list0g g t                | loop [x] = g x
87                  | loop (h :: t) = g h o text sep o loop t
88      fun listg g l = text "[" o list0g g l o text "]"          in text ld o loop l o text rd
89            end
90        fun listg g l = listg' "[" ", " "]" g l
91    
92      fun optiong g NONE = text "NONE"      fun optiong g NONE = text "NONE"
93        | optiong g (SOME a) = text "SOME(" o g a o text ")"        | optiong g (SOME a) = text "SOME(" o g a o text ")"
94    
95        fun list' ld sep rd e = elem (listg' ld sep rd (glue e))
96      fun list e = elem (listg (glue e))      fun list e = elem (listg (glue e))
97      fun option e = elem (optiong (glue e))      fun option e = elem (optiong (glue e))
98    

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

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