12-29-2011, 01:51 PM
LCD it won't
The idea is allowing DRAW, INK, etc. to be defined as Subs (not part of the inner language), and allow subs to be called without parenthesis.
So:
could be called either with
or this other way:
This won't break ZX Spectrum BASIC compatibility, and will allow to take Spectrum-specific instructions out (the same way SCREEN$, ATTR and POINT are now).
Simply, when a user specifies --arch=sinclair (or whatever), a hidden #include <sinclair> is inserted in the code silently. Note: something like this is already done for SCREEN$, ATTR and POINT when higher ZX Spectrum compatibility is enabled.
LCD Wrote:BTW: removing DRAW and using DRAW() will break the 100% spectrum compatibility, so Sinclair Basic programs cannot be compiled anymore. Not that I think this is a bad idea... I also do not use line numbers (I hate them).That was not the idea :!:
My idea is to keep DRAW and add a library LINE() or VECTOR() or DRAWTO(). Why to mimic their BASIC and not create one which is common for all the computers? I'm thinking about cross development. Incompatible commands will just cause a "Unsupported command" error.
The idea is allowing DRAW, INK, etc. to be defined as Subs (not part of the inner language), and allow subs to be called without parenthesis.
So:
Code:
SUB DRAW(unsigned x, unsigned y)
...
...
END SUB
Code:
DRAW(x, y): Rem Calling a SUB this way is already implemented
Code:
DRAW x, y: REM Calling a sub with no parenthesis (like Visual Basic)
Simply, when a user specifies --arch=sinclair (or whatever), a hidden #include <sinclair> is inserted in the code silently. Note: something like this is already done for SCREEN$, ATTR and POINT when higher ZX Spectrum compatibility is enabled.