For the roadmap, this might be a very useful idea: introduce constants / parameters in code. Apart from syntax and initialization, they should have the same status as globals (see the argumentation below).
The distinction with globals (on the one hand) and sliders etc. (on the other hand) is that they are automatically initialized, and not cleared by clear-all (and clearing-globals), but they are not visible in the interface.
For experimentation (sensitivity analysis, uncertainty analysis) these should be considered variable. BehaviorSpace can assign different values. This would solve a recurring problem (also addressed in NetLogo’s FAQ) of how to control “globals” by BehaviorSpace.
Another advantage is that constants / parameters stand clearly apart from true globals, improving readability of the model code.
In another simulation tool (for ODE models), that I have been maintaining for years, we had a long discussion about the distinction between constants and parameters. It depends very much on the point of view and purpose. The extreme cases are clear: fixed constants (like pi) and free parameters (in NetLogo typically sliders in the interface).
But for measured constants (like the speed of light) and arbitray numbers (like the number of agents of some kind), we might want to vary them for sensitivity analysis and uncertainty analysis, but not expose them in the interface.
There were still more arguments, not very relevant here, but in the end, we decided to make one category for “constants and parameters” with several kinds within the category.
Once, we have constants, we could also use them for the same purposes that other languages have symbolic constants for, especially avoiding magic numbers and magic strings.
For syntax, there would be several options. Given that free parameters are already in the interface, I would prefer a keyword constants (like globals) to introduce these constants / parameters.
Then each parameter could be introduced as a pair name–value, with for values either only literals or formulas that refer to earlier constants and literals only. So something like:
constants [
step-size 0.3
max-steps 5
max-distance max-steps * step-size ;; if we allow formulas
error-cannot-start "cannot start ..." ;; avoid magic string
]
Feel free to suggest other variants for the syntax.
Another question is whether code should be allowed to change the value of a constant. My answer is yes.
We are already allowed to change values of sliders (etc.) in code; changing a value through the Command Center can be useful; setup code in BehaviorSpace could set a value instead of using “vary variables as follows”; and this is still the start.
With these ideas, I think introduction of constants would not interfere with other aspects of NetLogo code.