MongooseA living laboratory of myriad worlds.

All help topics · Link to this topic

Showing help on 'eval()'

Syntax: eval (STR <line> [, STR <line> ...]) => LIST

The MOO-code compiler processes the given strings as if they were the program associated with some verb and, if no errors are found, that fictional verb is invoked.

If the programmer is not a programmer, then E_PERM is raised. If any argument is not a string, then E_TYPE is raised.

The normal result is a two-element list. The first element is true if there were no compilation errors and false otherwise. The second element is either the result returned from the fictional verb, if there were no compilation errors, or a list of the compiler's error messages otherwise.

When the fictional verb is invoked, player has the same value as in the calling verb, this is #-1, caller is the initial value of this in the calling verb, args is {}, argstr is "", verb is "", dobjstr is "", dobj is #-1, prepstr is "", iobjstr is "", and iobj is #-1.

The fictional verb runs with the permissions of the programmer and as if its d permissions bit were on.

Example:
eval("return 3 + 4;") => {1, 7}