Posts: 490
Threads: 95
Joined: Apr 2022
Reputation:
23
I'm thinking of adding the ability to use curly brackets and square brackets in expressions, along with parentheses, to make complex expressions easier to read.
But not if square brackets (i.e. [ and ] ) and curly brackets (i.e. { and } ) are used in any way as special characters in QB64pe.
Are square brackets and/or curly brackets used for any purpose in QB64pe? (I haven't noticed any.)
Posts: 70
Threads: 7
Joined: Apr 2022
Reputation:
10
Not that I know of
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience
Posts: 2,700
Threads: 124
Joined: Apr 2022
Reputation:
134
No I don't think other brackets are used.
Have you tried spacing out multiple brackets to make it clearer which nest you are in while you type a line in QB64 IDE? It can get confusing while composing.
b = b + ...
Posts: 224
Threads: 7
Joined: Apr 2022
Reputation:
14
some of the better IDEs and text editors will highlight opening and closing brackets to make editing expressions a little easier. There's no shame in using spaces or newlines to break up expressions although the PE ide may squish them together with autoindent enabled which is why I opt for my own formatting.
I would not recommend introducing alternative brackets especially if they are interchangeable. They sometimes do that in Math but not in Basic which is a practice I personally dislike because the other brackets can sometimes indicate a different purpose in other contexts
Posts: 2,700
Threads: 124
Joined: Apr 2022
Reputation:
134
If I may remind, while you remain on the same line of QB64pe the spaces remain spaced until you move onto the next line, THEN the spaces are pushed together.
And yes, the highlights are helpful in pointing the end bracket for the first on same level or vice versa.
b = b + ...
Posts: 593
Threads: 44
Joined: Apr 2022
Reputation:
43
Is this something that's being considered to be implemented in QB64PE?
Personally, I would find the use of multiple bracket types confusing in the BASIC dialect. Other languages, such as Python, use square brackets to identify constructs such as tuples which set them apart from evaluations. If I remember correctly I believe curly braces were used in Pascal (Delphi) for comment blocks. I don't believe I've ever run across a language that uses a mix of bracket types for evaluations. Again, my personal opinion, but I believe this would cause confusion.
Software and cathedrals are much the same — first we build them, then we pray.
QB64 Tutorial