Currently a runtime error occurs when a value is assigned to an accumulator or a memory cell that does not exist in the playground mode. Instead of the runtime error, the accumulator or memory cell should be created on demand, before the value is assigned. This should only be the case in the playground mode (maybe the whole behavior should be disableable using a cli argument).
To implement it, I think I could utalize the Settings struct in the RuntimeArgs struct, to add a new field that stores if memory cells/ accumulators should be created on demand. This could then also be used in the normal load mode, when enabled via command line argument.
Maybe the cli argument to enable that in the load mode could be something like --memory-on-demand. This should probably not conflict with any other parameters, as this would allow for all fields to be empty, when the program starts and that required fields are then only created if needed.
For the playground mode, disabling this automatic creation when needed, the argument could be --no-memory-on-demand.
The runtime settings are then set, according to the command issued and the parameters provided.
I decided against adding command line arguments, instead the accumulator/memory cells are now automatically created when required, except for when --disable-memory-detecion is set.
Currently a runtime error occurs when a value is assigned to an accumulator or a memory cell that does not exist in the playground mode. Instead of the runtime error, the accumulator or memory cell should be created on demand, before the value is assigned. This should only be the case in the playground mode (maybe the whole behavior should be disableable using a cli argument).
To implement it, I think I could utalize the
Settings
struct in theRuntimeArgs
struct, to add a new field that stores if memory cells/ accumulators should be created on demand. This could then also be used in the normal load mode, when enabled via command line argument.Maybe the cli argument to enable that in the load mode could be something like
--memory-on-demand
. This should probably not conflict with any other parameters, as this would allow for all fields to be empty, when the program starts and that required fields are then only created if needed.For the playground mode, disabling this automatic creation when needed, the argument could be
--no-memory-on-demand
.The runtime settings are then set, according to the command issued and the parameters provided.