views:

86

answers:

1

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.)

+2  A: 

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
Any thoughts on where in the source (that I am browsing but is heavily uncommented) I might find what I'm looking for?
rascher
Recent Basic versions already abandoned `Let`
Joel Coehoorn
It works already... See ast-node-misc.bas in the compiler code (round about line 442)
BnWasteland
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!
rascher

related questions