summaryrefslogtreecommitdiff
path: root/ipl/progs/genfile.icn
blob: 7347a4d115d349331e396bb43a79905fec4f5312 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
############################################################################
#
#	File:     genfile.icn
#
#	Subject:  Program to generate sequence from Icon expression in file
#
#	Author:   Ralph E. Griswold
#
#	Date:     January 22, 1999
#
############################################################################
#
#  This file is in the public domain.
#
############################################################################
#
#  This program writes the results of an Icon expression given in the file
#  named on the command line.
#
############################################################################
#
#  Requires:  system(), pipes
#
############################################################################
#
#  Links:  exprfile
#
############################################################################

link exprfile

procedure main(args)
   local expression, input, limit

   limit := 1000		# AD HOC; make option.

   input := open(args[1]) | stop("*** cannot open file")

   expression := read(input) | stop("*** empty file")

   close(input)

   input := exprfile(expression, "seqfncs")

   every write(!input) \ limit

end