home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / progs / applyfnc.icn < prev    next >
Text File  |  2000-07-29  |  758b  |  31 lines

  1. ############################################################################
  2. #
  3. #    File:     applyfnc.icn
  4. #
  5. #    Subject:  Program to apply function to lines of a file
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     November 25, 1996
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program applies a function specified on the command line to the
  18. #  lines of a file.
  19. #
  20. ############################################################################
  21.  
  22. procedure main(args)
  23.    local func
  24.  
  25.    func := args[1] | stop("*** no function specified")
  26.  
  27.    while args[1] := read() do
  28.       every write(func ! args)
  29.  
  30. end
  31.