commanderx16 / x16-rom

Other
153 stars 44 forks source link

Feature Request: Improved and Extended Variable Names #172

Open Starsickle opened 4 years ago

Starsickle commented 4 years ago

This was something discussed on the forums, but this feature would allow the interpreter to see variable names of greater length and not compress them down to the first two characters. This would be tremendously useful, and should be sought as an improved feature.

Example: Currently, "ABC" is the same name as "AB". As programs become larger, this makes the task of programming and organizing a project much harder to do, and requires documentation be shared with all members, which can be taxing and introduce many hardships to design and implementation.

Of course, this requires deep understanding and rewrite of the interpreter in order to fix, especially between target platforms. However, I think being able to use meaningful names - even if it requires specific platform targeting or compilation or linking process - is a very worthy feature that would help its usability a lot given the expanded capabilities of the machine.

BruceMcF commented 4 years ago

This requires changes all through the interpreter. Likely the one requiring the fewest changes would be to simply raise the number from two to four, and that would still be well worthwhile.

The logic for long variable names might be taken from the newly open sourced GW Basic, but that would require a careful examination of how the logic of the GW Basic interpreter has changed overall from the logic of the 8080 Basic that was ported to 6502 Basic.

Now, I did not use Basic in DOS, I used BAT, AWK and C, so whether that transition to long variable names happened with GW Basic or with QBasic is not something I know off the top of my head. If it happened with QBasic, then the logic of the DOS GW Basic interpreter would be of no help.

bobbyjim commented 4 years ago

I have hopes that a "Structured BASIC" is being cooked up for one of the unused ROM banks...

BruceMcF commented 4 years ago

Yes, but as ROMBasic will still be the "batch file" language, 4 significant character names would still be a lot nicer.

bobbyjim commented 4 years ago

Agreed - doubling the length helps. As it is I use a primitive cross-transpiler that renders down to BASIC 2...