etamoo

Safe HaskellNone
LanguageHaskell2010

MOO.Builtins

Synopsis

Documentation

builtinFunctions :: HashMap Id Builtin Source

A HashMap of all built-in functions, keyed by name

callBuiltin :: Id -> [Value] -> MOO Value Source

Call the named built-in function with the given arguments, checking first for the appropriate number and types of arguments. Raise E_INVARG if the built-in function is unknown.

verifyBuiltins :: Either String Int Source

Perform internal consistency verification of all the built-in functions, checking that each implementation actually accepts the claimed argument types. Note that an inconsistency may cause the program to abort.

Assuming the program doesn't abort, this generates either a string describing an inconsistency, or an integer giving the total number of (verified) built-in functions.