scruss wrote: ↑
Tue Jun 30, 2020 6:24 pm
the lower-case immediate mode commands were handy.
From a historical BBC BASIC perspective, allowing lowercase commands
but not lowercase statements
makes no sense. In all early versions the commands shared the same token space as all the other keywords, indeed there was nothing to stop you putting a command in a program (it would execute but then exit to immediate mode). So commands inevitably needed to be in capitals as well.
What I do in my BASICs (BBC BASIC for Windows
and BBC BASIC for SDL 2.0
) is to allow you to enable lowercase keywords if you wish - although it's not recommended - but that option affects statements, functions and commands (when available) equally
Incidentally it's not always appreciated that one reason why BBC BASIC doesn't allow lowercase keywords (or when it does it is deprecated) is because of the relatively unusual characteristic of the language that keywords don't always have to be separated from what follows. So whilst in most languages you would need to write something like SIN(RAD(angle))
BBC BASIC will allow SINRADangle
. The reason for this, of course, was to allow spaces to be omitted and make the program more compact, which could be important with the very restricted memory of the BBC Micro.
Because of this feature, allowing lowercase keywords causes many variable names to become illegal: printer
(not allowed because it's parsed as print er
(because it's parsed as val ue
) etc. There are so many examples that allowing lowercase keywords can be quite a pain.