Heater wrote: ↑
Sat May 11, 2019 9:09 pm
I have been keeping an eye on all things personal computing since ever there were such things. Never heard of "Liberty BASIC" until someone mentioned it recently in the "avoiding BASIC" thread.
You said you had not heard of PowerBasic either so I am not convinced you have actually been keeping an eye on things at all.
I was trying to remember where I first saw square brackets used to enclose labels but can't. I thought it might be Pilot or SNOBOL, but no. Probably something less well known or more esoteric, but likely from the 70's. Ada uses double chevrons <<label>>.
I have used square brackets, chevrons and other symbols to indicate labels in languages I have invented to get things done over the years. It's easier to parse and syntax check when the prefix identifies the token type it is rather than have to look ahead. It also avoids the whole issue of whether an alphanumeric is a label or the name of a procedure to be defined later which is to be called when that's allowed.
Plus it allows reserved words to be used as labels, and bracketing allows embedded spaces and non-alphanumeric symbols, all of which can be useful at times.
Single characters prefixes can be used for label definitions; eg : in Batch files, but where it's a bracket it makes sense to include the closing bracket for aesthetic reasons. Whether a GOTO or GOSUB needs to include the decoration, already knowing a label must follow, is equally a matter of aesthetics and preference, and whether a variable can be used as well as a literal label. Which can also influence how a label must be.
But I would guess, as it usually is, it's was more a case of "how do I crowbar that
into the rest of what I have?" and that was an easy solution, and good enough.