如题,今天突然发现
NetLogo中setup程序的调用在js中是
ProcedurePrims.callCommand("setup")
但是main报告器的调用在js中却是
PrimChecks.procedure.callReporter(31, 35, "main", 3)
如题,今天突然发现
NetLogo中setup程序的调用在js中是
ProcedurePrims.callCommand("setup")
但是main报告器的调用在js中却是
PrimChecks.procedure.callReporter(31, 35, "main", 3)
PrimChecks.procedure.callReporter也调用了procedurePrims.callReporter,但是多了一层参数解构就意味着像匿名函数的封装一样调用效率大打折扣了
callReporter(sourceStart, sourceEnd, name, ...args) {
var result;
result = this.procedurePrims.callReporter(name, ...args);
if (result === void 0) {
this.validator.error('report', sourceStart, sourceEnd, 'Reached end of reporter procedure without REPORT being called.');
}
return result;
}
顺带一提错误位置的跟踪只在to-report程序没有返回值时被使用,感觉作用不大