Advertisement
Guest User

Untitled

a guest
Nov 15th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. val args = CommandLine.arguments();
  2.  
  3. fun print_file "-" =
  4.         let
  5.         val c = ref ""
  6.       in
  7.         while (c := TextIO.inputN (TextIO.stdIn, 1); !c <> "") do
  8.           TextIO.output (TextIO.stdOut, !c)
  9.       end
  10.     | print_file f =
  11.         let
  12.         val f = TextIO.openIn f
  13.         and c = ref ""
  14.       in
  15.         while (c := TextIO.inputN (f, 1); !c <> "") do
  16.           TextIO.output (TextIO.stdOut, !c);
  17.         TextIO.closeIn f
  18.       end
  19. ;
  20.  
  21. fun iter_files [] = ()
  22.     | iter_files (x::xs) = (
  23.             print_file x;
  24.             (iter_files xs)
  25.         )
  26. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement