Closed qiemem closed 7 years ago
Thoughts on how to do this:
If these primitives only required running NetLogo code, we could just append the procedure definitions to the end of the code when loading the model. Unfortunately, they require actually calling scala code.
We may be able to take advantage of the extensions api to inject what amount to extension procedures. Need to look into this.
The current plan: define a ClassManager
in ls that defines these primitives, load it via an InMemoryExtensionLoader
, which is attached to the workspace via workspace.extensionManager.addLoader
.
This will require moving InMemoryExtensionLoader
to from test to main, which should be done in the same PR that I update the ls pointer in core.
We decided against this as being too magical and weird.
Could be a great replacement for
ls:close
ls:model-id
ls:show
/ls:hide
maybe?The idea is to enable stuff like this: