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
/
evaluate.icn
< prev
next >
Wrap
Text File
|
2000-07-29
|
1KB
|
44 lines
############################################################################
#
# File: evaluate.icn
#
# Subject: Program to evaluate Icon expressions
#
# Author: Ralph E. Griswold
#
# Date: March 4, 1995
#
############################################################################
#
# This file is in the public domain.
#
############################################################################
#
# This program evaluates Icon operations given from standard input in
# functional form. It cannot handle nested expressions or control
# structures. See eval.icn for more details.
#
# There is one option:
#
# -l i limit on number of results from a generator; default 2 ^ 30
#
############################################################################
#
# Links: eval, options
#
############################################################################
link eval
link options
procedure main(args)
local expr, opts, limit
opts := options(args, "l+")
limit := \opts["l"] | 2 ^ 30
while expr := read() do
every write(eval(expr)) \ limit
end