ivalue.icn: Procedures to convert string to Icon value

procedure ivalue:          convert string to Icon value

link ivalue
October 12, 1996; Ralph E. Griswold
This file is in the public domain.

This procedure turns a string from image() into the corresponding Icon
value.  It can handle integers, real numbers, strings, csets, keywords,
structures, and procedures.  For the image of a structure, it produces a
result of the correct type and size, but any values in the structure
are not likely to be correct, since they are not encoded in the image.
For procedures, the procedure must be present in the environment in
which ivalue() is evaluated.  This generally is true for built-in
procedures (functions).

All keywords are supported even if image() does not produce a string
of the form "&name" for them.  The values produced for non-constant
keywords are, of course, the values they have in the environment in
which ivalue() is evaluated.

ivalue() also can handle non-local variables (image() does not produce
these), but they must be present in the environment in which ivalue()
is evaluated.

Source code | Program Library Page | Icon Home Page