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 /archive/0.93/doc/examples/awk/tally.sml
ViewVC logotype

View of /archive/0.93/doc/examples/awk/tally.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4958 - (download) (annotate)
Wed Apr 10 01:33:29 2019 UTC (3 months ago) by dbm
File size: 388 byte(s)
adding 0.93 src and doc to archive
structure Table = StringTable(type elem = int val default = 0);

val table = Table.new();

fun step (fields: string list) =
    let val name::value::_ = fields
     in Table.set table (name, Table.get table name + Awk.makeInt value)
    end

fun final () =
    Table.app table (fn (s,n) => (print s; print "\t"; print n; print "\n";()))

(* invoke by

   Awk.awk(stream,step,final)

*)



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