A primitive type representing a running or sleeping proc. This gives access to the proc’s information, and can be used to output a stack trace in situations such as writing your own custom world.Error()
handler.
You can get a /callee
for the current running proc with its callee var, or its caller with the caller var. You can follow callers up the call chain.
world/Error(err)
world.log << "Error [err]:"
for(var/callee/p = caller, p, p = p.caller)
world.log << " [p.proc.type] (src=[p.src], usr=[p.usr])"
if(p.file) world.log << " at [p.file]:[p.line]"
Built-in callee vars (read-only):
* These vars are quick aliases for proc.*varname*
. proc.type
is excluded since /callee
has its own type var.
The file
and line
vars are available if debugging information was turned on when the world was compiled. The other vars are all aliases for info about the running/sleeping proc or its prototype.
Even though the args
var itself is read-only, the list it returns is mutable. Making changes to the list will affect the proc it belongs to.