-->
Page 1 of 1

Modular scripts

PostPosted: Tue Oct 11, 2016 9:45 am
by Electroguard
Mmiscool, are there any working examples showing the use of LOAD command to 'chain' in program modules?

Have you considered the possibility of being able to GOSUB and RETURN to/from [filename] subroutine modules?

Re: Modular scripts

PostPosted: Wed Oct 12, 2016 11:44 pm
by livetv
That ability would be very handy. I do occasionally use LOAD but GOSUB capability would be nice.

I see a potential problem with the pre-processing/optimization involved. There would have to be a way of constructing and deconstructing the lookups in the child processes. When using LOAD, all that in the parent process is discarded and the child process (a misnomer in this case) is set up as a main process and this is not an issue. Perhaps the extra space taken up by child processes isn't that significant and perhaps they can be optimized upon first use and kept but we still have to contend with changes to child process code while the main process is running. I know I'd be guilty.

One way to solve this would be to have "on the fly" optimization with a caching scheme that allows the most used code to remain in cache and optimized. Kind of a tall order. It would be easier to allow construction and destruction of child process reference data.