有没有办法将我定义的单词保存到文件中,以便以后继续试验?
到目前为止,我找到了从控制台复制+粘贴定义的唯一方法,如果它们仍然可见的话。
我是从头开始的,所以我犯了很多错误并在以后更正它们,我想保存我之前定义的单词并在下一个会话中重复使用它们。
这是一个简单的例子:
Gforth 0.7.3, Copyright (C) 1995-2008 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit
:hello ."hello";
:1: Undefined word
>>>:hello<<< ."hello";
Backtrace:
$7F29BBAB3A00 throw
$7F29BBAC9C98 no.extensions
$7F29BBAB3CC0 interpreter-notfound1
: hello ."hello";
:2: Undefined word
: hello >>>."hello";<<<
Backtrace:
$7F29BBAB3A00 throw
$7F29BBAC9C20 no.extensions
$7F29BBAB7338 compiler-notfound1
: hello ." hello"; ok
: 2hello hello hello ; ok
2hello hellohello ok
: hello ." hello "; \ added space to end redefined hello ok
2hello hellohello ok
: 2hello hello hello ; redefined 2hello ok
2hello hello hello ok
bye
现在我有工作hello
(最后有空格)和工作2hello
(使用编辑hello
) - 可以说,我有更多的麻烦来解决2hello
定义形式和定义hello
现在不在屏幕上。
- 有没有办法保存
hello
并保存2hello
到文件中,我可以在第二天使用它来制作更复杂的单词? - 它可以是文本文件吗,所以我可以使用一些编辑器(比如
vim
)来清理所有错误的定义并评论那些我想保留的?
我想以文件welcome.fth 结束:
: hello \ -- ; say hello and space at the end of word, to be able simply concatenate that
." hello ";
: 2hello \ -- ; repeats hello two times
hello hello ;
第二天就能来,继续发现
Gforth 0.7.3, Copyright (C) 1995-2008 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit
include welcome.fth ok
2hello hello hello ok
\ now I can continue with learning