Closed skx closed 5 years ago
QBasics named subs and functions are nice, you end up not needing line numbers
Yeah if you had names you'd not need numbers - right now they're basically ignored except for GOTO/GOSUB.
I'm still in two minds about this, to be honest I expect the natural compromise would be to implement DEF FN
. That would allow calling things by name, and also be a challenge to implement.
(Edit: User-defined functions now exist :)
Soo... does this future examples won't have line numbers :rofl:
More QBasic compatibility in the future ? (though we do already have QB64 for that)
I decided that I'd leave as-is. The addition of user-defined functions goes most of the way towards offering useful/reusable functions.
Adding too many extra things takes it away from the Sinclair BASIC I used to use.
:)
I could imagine this, to allow you to GOTO/GOSUB via ident:
However neither helps if you want to renumber your programs. (Well I guess they add clarity.) However this would:
Do we want to add such things? Maybe. Filed as a fantasy for the moment.