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/system/Basis/Implementation/NJ/prof-control.sml
ViewVC logotype

Diff of /sml/trunk/src/system/Basis/Implementation/NJ/prof-control.sml

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

revision 1648, Tue Oct 12 22:47:46 2004 UTC revision 1649, Tue Oct 12 22:48:53 2004 UTC
# Line 91  Line 91 
91            }];            }];
92    
93    (* count the number of newlines in a string *)    (* count the number of newlines in a string *)
94      fun newlines s = let      fun newlines s =
95            fun notNL #"\n" = false | notNL _ = true          CharVector.foldl (fn (#"\n", n) => n + 1 | (_, n) => n) 0 s
           fun f (ss, count) = let  
                 val ss = Substring.dropl notNL ss  
                 in  
                   if Substring.isEmpty ss  
                     then count  
                     else f (Substring.triml 1 ss, count+1)  
                 end  
           in  
             f (Substring.all s, 0)  
           end  
96    
97      fun register names = let      fun register names = let
98          val list = !units          val list = !units

Legend:
Removed from v.1648  
changed lines
  Added in v.1649

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