diff options
Diffstat (limited to 'ipl/progs/genfile.icn')
-rw-r--r-- | ipl/progs/genfile.icn | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/ipl/progs/genfile.icn b/ipl/progs/genfile.icn new file mode 100644 index 0000000..7347a4d --- /dev/null +++ b/ipl/progs/genfile.icn @@ -0,0 +1,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 |