Implement support for creating arrays stored in multiple external memory blocks. A large array will be split into segments stored in individual cells/banks. The entire cell/bank is reserved for the big array. Array access firstly locates the correct cell/bank, and then uses the block in question for access.
Features:
- Declared using the linked arrays syntax (see below).
- All memory blocks must be of the same type (memory cell, memory bank or world cell).
- Only a single array may be stored in a single group of memory blocks.
The list of memory blocks will be stored at the end of the very last memory block, or as an internal array (if there's no space in the last memory block). To access an element, the block index and position will be calculated (using div and mod by the block size), the block will be read and then the element will be read.
A list iteration loop over the array might be implemented as two nested loops, one looping over the cells and the other over the elements in the cell. Includes parallel loops over two arrays of the same structure and size.
Declaration syntax:
external(bank1 .. bank2) var array[1000];
// Or with separately specified linked array, allowing for symbolic link names
linked(@memory-bank) memory[] = (mem1 .. mem8);
external(memory) var array[4000];
The type of the memory block must be discernible by the compiler. Either symbolic links are used (as seen above), or the type of the memory will be derived from the link name (cell versus bank). When using a world processor, cell will be assumed to represent a world cell. After data types get implemented, it will be possible to specify an exact data type and avoid the ambiguity.
It will be always possible to specify the exact data type by using symbolic link names. It's a fully working solution, even if a bit limiting.
Planned for Mindcode 3.20.
Implement support for creating arrays stored in multiple external memory blocks. A large array will be split into segments stored in individual cells/banks. The entire cell/bank is reserved for the big array. Array access firstly locates the correct cell/bank, and then uses the block in question for access.
Features:
The list of memory blocks will be stored at the end of the very last memory block, or as an internal array (if there's no space in the last memory block). To access an element, the block index and position will be calculated (using div and mod by the block size), the block will be read and then the element will be read.
A list iteration loop over the array might be implemented as two nested loops, one looping over the cells and the other over the elements in the cell. Includes parallel loops over two arrays of the same structure and size.
Declaration syntax:
The type of the memory block must be discernible by the compiler. Either symbolic links are used (as seen above), or the type of the memory will be derived from the link name (
cellversusbank). When using a world processor,cellwill be assumed to represent a world cell. After data types get implemented, it will be possible to specify an exact data type and avoid the ambiguity.It will be always possible to specify the exact data type by using symbolic link names. It's a fully working solution, even if a bit limiting.
Planned for Mindcode 3.20.