Starting FORTH的第3章说,
现在您已将块设为“当前”,只需键入单词
L
即可列出。与LIST
不同,L
不希望以块编号进行;相反,它列出了当前的块。
当我运行180 LIST
时,我得到了
Screen 180 not modified
0
...
15
ok
但是当我运行L
时,我收到错误
:30: Undefined word
>>>L<<<
Backtrace:
$7F0876E99A68 throw
$7F0876EAFDE0 no.extensions
$7F0876E99D28 interpreter-notfound1
我做错了什么?
答案 0 :(得分:1)
事实证明这些是“编辑命令”,这本书说,
对于那些编辑不遵守这些规则的人
FORTH-79标准不指定编辑器命令。您的系统可能使用不同的编辑器;如果是这样,请检查您的系统文档
我不相信gforth完全支持内部编辑器。因此L
,T
,I
,P
,F
,E
,D
,R
都是可能没有支持。
答案 1 :(得分:1)
gforth与emacs完美集成。在我的xemacs中,默认情况下,任何名为* .fs的文件都被视为FORTH源。像往常一样,“C-h m”给出了可用的命令。
答案 2 :(得分:1)
是的,gForth支持内部(BLOCK)编辑器。启动gforth
use blocked.fb
(演示页面)1 load
editor
words
将显示编辑器单词,
s b n bx nx qx dl il f y r d i t 'par 'line 'rest c a m ok
键入0 l
以列出描述编辑器的屏幕0,
Screen 0 not modified
0 \\ some comments on this simple editor 29aug95py
1 m marks current position a goes to marked position
2 c moves cursor by n chars t goes to line n and inserts
3 i inserts d deletes marked area
4 r replaces marked area f search and mark
5 il insert a line dl delete a line
6 qx gives a quick index nx gives next index
7 bx gives previous index
8 n goes to next screen b goes to previous screen
9 l goes to screen n v goes to current screen
10 s searches until screen n y yank deleted string
11
12 Syntax and implementation style a la PolyFORTH
13 If you don't like it, write a block editor mode for Emacs!
14
15
ok
要创建自己的新阻止文件myblocks.fb
use blocked.fb
1 load
editor
然后
use myblocks.fb
1 load
将显示第1块(第0到15行。每16行由64个字符组成)1 t
将突出显示第1行i this is text
以[i]插入第1行flush
以便将BLOCK#1写入文件myblocks.fb
有关更多信息,请参见gForth Blocks
答案 3 :(得分:0)
不,GNU Forth没有内部编辑器;我用Vim :)