SMOP Interpreter Implementation API
This is the API that must be implemented by any interpreter that wants to have its run loop integrated with the SMOP Run Loop.
- Running operations
- has_next($interpreter: ) -- called before next to see if there is something to be evaluated.
- next($interpreter: ) -- called before eval to prepare the next node.
- eval($interpreter: ) -- evaluate the current instruction.
- setr($interpreter: $value) -- receive information from other continuation. Usually, these are arguments or return values.
- Introspection operators
- caller($interpreter: ) -- returns the continuation that precedes the current one.
- lexical($interpreter: ) -- returns lexical information about the current execution.
- jail($interpreter: ) -- returns the jail information that any exception-like operator would check to loop for a safe point.
- debug($interpreter: ) -- returns debug information about the current execution.
The Debug API
This is completely vague now. The only thing that are presumably interesting to be available are:
- file name
- line number
- character position range (if available)
- source code
The Lexical API
SMOP Lexical Scope Implementation