The single character operators are a bit of a trick used to make part of the compiler slightly simpler. I was very inexperienced when I wrote the code that handles equations, and decided that things could be kept simpler if all operators were a single character. Because ~, { and } have no other meaning to the compiler, those were what I used for <>, <= and >=.
If that part of the compiler gets a rewrite at any point in the future, the single character versions could disappear, so please use <>, <= and >= (as you would in QBASIC or FreeBASIC).
(We can probably keep =< though, I don't think that has any other meaning in any other BASIC dialect?)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So I can continue with my "preferred"
">="
and
"=<"
without issues.
I don't think I'd enjoy the "{" , "}" versions. I would be forever worried about seeing unmatched opening/closing braces. I'd have to add another nearby and close them...
The "~" wouldn't offend me in the same way, but it might well confuse me. As I've been happily using "<>" for decades, I think I'll stick with that.
I woke up this morning, thinking of some code I was going to write, and it had been worrying me in my sleep whether it was "<=" or "=<". Then of course I wondered if I'd been using the wrong one. At least there is no wrong one.
The relief, phew! I'll hopefully not be waking up in a cold sweat early tomorrow morning.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So please use <>, <= and >= (as you would in QBASIC or FreeBASIC).
Alrighty then. <>, <= and >= it will be from now on.
Could I request that if the compiler is updated so that "=<" and "=>" stop working, an error is displayed please? Otherwise I'll be deep in the brown stuff...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
also I always use not port instead of ! port because ! did not mean not in any other basic I learnt.
edit how is not the same as <> ? I thought it was a bit operation, "not" a comparison of2 vars.
I found that var-- , ie var=var-1
compiles same as var--- ,,,,,which it should be
both work???
Last edit: stan cartwright 2021-01-25
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here's my contribution to daftest question of the week.
When testing a value to see if it is greater than, or less than a limit I'd write...
Less than:
For greater than:
If I want to test for a value that is Less than or equal to:
But should that be:
Likewise, should I write:
Or:
Then for something this is not equal to a given value I tend to use:
Alternatively could I (should I) use:
Or...
Does any of this matter to GCB or will I end up with the same results?
Great questions....
"=>" the same as ">=" and is "}"
"=<" the same as "=<" and is "{"
"<>" the same as "~"
The single character operators are a bit of a trick used to make part of the compiler slightly simpler. I was very inexperienced when I wrote the code that handles equations, and decided that things could be kept simpler if all operators were a single character. Because ~, { and } have no other meaning to the compiler, those were what I used for <>, <= and >=.
If that part of the compiler gets a rewrite at any point in the future, the single character versions could disappear, so please use <>, <= and >= (as you would in QBASIC or FreeBASIC).
(We can probably keep =< though, I don't think that has any other meaning in any other BASIC dialect?)
So I can continue with my "preferred"
">="
and
"=<"
without issues.
I don't think I'd enjoy the "{" , "}" versions. I would be forever worried about seeing unmatched opening/closing braces. I'd have to add another nearby and close them...
The "~" wouldn't offend me in the same way, but it might well confuse me. As I've been happily using "<>" for decades, I think I'll stick with that.
I woke up this morning, thinking of some code I was going to write, and it had been worrying me in my sleep whether it was "<=" or "=<". Then of course I wondered if I'd been using the wrong one. At least there is no wrong one.
The relief, phew! I'll hopefully not be waking up in a cold sweat early tomorrow morning.
Alrighty then. <>, <= and >= it will be from now on.
Could I request that if the compiler is updated so that "=<" and "=>" stop working, an error is displayed please? Otherwise I'll be deep in the brown stuff...
Well... removing stuff is actually harder than adding stuff.... removing means we could impact/break existing code.
:-)
I should be safe for a while then ;-)
You didn't say anything about using != instead of <>, is that more inefficient, i.e. does it do a "not" before comparing?
I have always used, because it was not optional
also I always use not port instead of ! port because ! did not mean not in any other basic I learnt.
edit how is not the same as <> ? I thought it was a bit operation, "not" a comparison of2 vars.
I found that var-- , ie var=var-1
compiles same as var--- ,,,,,which it should be
both work???
Last edit: stan cartwright 2021-01-25