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

SCM Repository

[smlnj] View of /sml/trunk/src/MLRISC/library/line-break.sml
ViewVC logotype

View of /sml/trunk/src/MLRISC/library/line-break.sml

Parent Directory Parent Directory | Revision Log Revision Log

Revision 651 - (download) (annotate)
Thu Jun 1 18:34:03 2000 UTC (19 years ago) by monnier
File size: 542 byte(s)
bring revisions from the vendor branch to the trunk
signature LINE_BREAK =
    val lineBreak : int -> string -> string

structure LineBreak : LINE_BREAK =
   fun lineBreak maxChars text =
   let fun loop([],_,text) = String.concat(rev text)
         | loop(s::ss,n,text) = 
           let val m = String.size s + 1
               val n' = m+n
           in  if n' > maxChars 
               then loop(ss, m, s::" "::"\n"::text)
               else loop(ss, n', s::" "::text)
       val toks = String.fields (fn c => c = #" ") text
   in  loop(toks, 0, []) end

ViewVC Help
Powered by ViewVC 1.0.0