Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
表示如下输入的正确样式是什么,例如 Gforth 中的输入?
while (2 > 1) {1 + 1}
以我目前对网上资源的理解,应该是:
: loop begin 2 @ 1 > while 1 1 + repeat
但是,当我尝试用 Gforth 解释这一点时,我得到一个错误:
expected dest, do-dest or scope : >>>loop<<< begin 2 @ 1 > while 1 1 + repeat
您发布的代码有四个问题:
loop
;
@
2 1 >
1 1 +
我建议这样做:
: infinite begin 2 1 > while 1 1 + drop repeat ;
这几乎正是 ruvim 在评论中发布的内容。