4

Anyone who grew up on BASIC, and later switched to another language, had a real difficulty getting used to "(a == b)" rather than "(a = b)" to test for equality.

Is there a dialect of BASIC which uses the "==" operator for comparisons rather than overloading "=" for assignments and comparisons? Or - and maybe this is stretching it - is there an implementation which might be easily hackable to use this behavior (to change the tokens recognized by the parser?)

This can be a DOS/Windows/Linux implementation, and doesn't have to be terribly fully-featured. (I'm using this for instructional purposes.)

poundifdef
  • 18,726
  • 23
  • 95
  • 134
  • 1
    Another comment.... If you want to instruct, I like python. It's a bit more forgiving. Has higher-level concepts, and could be used for more complex projects as the student's skillset matures. – BnWasteland Feb 15 '10 at 01:00

1 Answers1

2

Isn't the reason for the double-equal in algol family to distinguish equality from assignment? What, then, would you have us do with the "LET" keyword? Abandon it? It was my favorite keyword! So permissive...

http://www.freebasic.net/

Open source, FTW!

BnWasteland
  • 2,109
  • 1
  • 18
  • 14
  • Any thoughts on where in the source (that I am browsing but is heavily uncommented) I might find what I'm looking for? – poundifdef Feb 15 '10 at 01:01
  • It works already... See ast-node-misc.bas in the compiler code (round about line 442) – BnWasteland Feb 15 '10 at 02:08
  • I see that... but it doesn't work. As in, the freebasic compiler gives a syntax error when I try to use ==. (Also... that doesn't "disable" the "=" for use as a comparator). I will keep digging through code, but let me know if you come up with something! – poundifdef Feb 15 '10 at 06:53