| eval |
(Object source [, String name]) |
reserved |
| |
Translates and executes Yoix statements read from
source,
which currently must be a
String
or
Stream.
Execution occurs in the current context and
eval
immediately returns on any error.
There is no default return value, but a Yoix statement
return(obj);
in
source
that is actually executed means
obj
will be the value returned by
eval.
When
source
is a
String
or
StringStream
the optional
name
argument or
-string-
will be used to identify
source
in error messages, otherwise
source
must be a
File
or
URL
and the
name
argument will be ignored and instead the value assigned to the
name
field in
source
will be used.
| |
| Example: |
The simple program
import yoix.stdio.*;
int x = 1;
eval("x += 4; int y = 7 + x;");
printf("x=%d, y=%d\n", x, y);
prints
x=5, y=12
on standard output, which shows how
eval
can affect the current context.
| | |
| Return: |
any
| | |
| See Also: |
execute,
exit
|
|
Yoix is a registered trademark of AT&T Inc.
|