ieval is a program to interactively evaluate icon expressions. Input is read from the terminal until end-of-file (control-D) is entered. Each expression has its results sequence evaluated and printed (although see the
!q option below). Variables may be assigned to, and they are stored in a local environment, which may be printed by entering
!env. To link with library packages, use the
-i command line option. Packages can't be imported interactively.
An example session
$ ieval -i lang,graphics > &version "Object Icon Version 2.6. Mon Aug 29 11:57:11 BST 2011" > upto('aeiou', "The quick brown fox") 3 6 7 13 18 > w := Window() object graphics.Window#1(ptr=136611152) > w.close() object graphics.Window#1(ptr=0) > ^D $
Input of an expression over several lines can be achieved by ending a line with a backslash character. The prompt changes to
>> and the next line is concatenated to the previous one.
ieval accepts the following command-line options :-
-ioptions may be given.
-loptions may be given.
Remaining arguments specify files which are processed before command line input commences. They should contain valid expressions (which may be compound expressions).
ObjectOutputStreamused to output results.
OutputStreamof the terminal (or window if using the graphical interface).
ieval is started with the
-s option, it keeps a history of entered expressions, and uses the following keyboard shortcuts :-
Goto a particular history number with
^P typed after the number, eg
Search for a history item by typing
^R (backward) or
^T (forward) after a string prefix, eg
will search backwards for the next history item beginning with
^_performs an undo (
^Zon the graphics version).
^Yperforms a redo.
Homegoes to start of line.
Endgoes to end of line.
^Kdeletes to end of line (deletes whole line on the graphics version).
^Gresets, ie abandon all edits and goes to end of history.
TABproduces a list of possible completions. This only works in gui mode, or in text mode if using flowterm as a terminal.
PGUPin gui mode, scrolls the history up
PGDN in gui mode, scrolls the history down