是否有使用“==”的 BASIC 方言?作为比较运算符?
任何在 BASIC 环境下长大,后来转向另一种语言的人,都很难习惯使用“(a == b)”而不是“(a = b)”来测试相等性。
是否有一种 BASIC 方言使用“==”运算符进行比较,而不是重载“=”进行赋值和比较?或者 - 也许这正在扩展它 - 是否有一个实现可以很容易地使用这种行为(以更改解析器识别的标记?)
这可以是 DOS/Windows/Linux 实现,并且不必功能非常齐全。 (我将其用于教学目的。)
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.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
algol家族中的双重等于的原因不是为了区分相等和赋值吗?那么,您希望我们如何处理“LET”关键字呢?放弃它?这是我最喜欢的关键词!如此宽容...
http://www.freebasic.net/
开源,FTW!
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!