是否有使用“==”的 BASIC 方言?作为比较运算符?

发布于 2024-08-21 07:03:55 字数 232 浏览 7 评论 0原文

任何在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挥剑断情 2024-08-28 07:03:55

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文