API Change Log - NetLogo/Tortoise GitHub Wiki

Changes Since 2.8.4

Procedure Definitions and Calling

Previously the global procedures object contained the generated procedures keyed by their name and a secondary "internal name", and could be called directly by accessing them by name, like procedures['go'](). Now procedures are defined using the ProcedurePrims.defineCommand() and ProcedurePrims.defineReporter() methods. Procedures can now be called using ProcedurePrims.callCommand() and ProcedurePrims.callReporter(), so ProcedurePrims.callCommand('go'). Any arguments for the procedure can also be passed into the appropriate call*() method after the procedure name.

You can check if a procedure exists using the ProcedurePrims.hasCommand() and ProcedurePrims.hasReporter() methods, passing in the procedure name you're checking for.

Runtime Error Stack Traces

Many runtime errors will now generate stack traces. The RuntimeException class includes a pre-generated stackTraceMessage property that compiles the stack trace into a string, and also a stackTrace property with is an array of stack frame objects, each with a type (currently one of "command", "reporter", or "plot"), a name, and a location (with start and end indexes from the compiled code) if you need programmatic access to the information.

⚠️ **GitHub.com Fallback** ⚠️