11-03-2011, 02:33 PM
LCD Wrote:This cannot be done with a linked list?
sprite.x(nr)
sprite.pointer(nr)
or similar?
This is something I'd like to discuss. Instead of copying C++ or the like syntax, design a new one. more close to BASIC. For example:
- No pointers but references instead (like Java or Python) :?:
Code:sprite.x(nr)
sprite.nextSprite.x(nr) - List containers embedded in the language :?:
Note: List can be implemented just with the references/pointer implementation above, but this is more BASIC sugar-syntax IMHO ;-)Code:REM an Array is a container with all elements of the same type
REM A list is not
A = [1, "Hello", sprite]
A = A + [More, Elements] : REM Dynamic
PRINT A(3)
REM Sublisting
B = A(2 TO 5)
Please, discuss :!: