GNU FORTH是否有编辑器? [英] Does GNU FORTH have an editor?
本文介绍了GNU FORTH是否有编辑器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
启动FORTH 的第3章,
现在,您已经将一个块设为当前",您可以通过简单地键入单词"
L
"将其列出.与LIST
不同,L
不想以块号开头.而是列出当前块.
Now that you've made a block "current", you can list it by simply typing the word
L
. UnlikeLIST
,L
does not want to be proceeded by a block number; instead it lists the current block.
运行180 LIST
时,我得到
Screen 180 not modified
0
...
15
ok
但是当我运行L
时,我得到一个错误
But when I run L
, I get an error
:30: Undefined word
>>>L<<<
Backtrace:
$7F0876E99A68 throw
$7F0876EAFDE0 no.extensions
$7F0876E99D28 interpreter-notfound1
我在做什么错了?
推荐答案
是的,gForth支持内部(BLOCK)编辑器.启动gforth
Yes, gForth supports an internal (BLOCK) editor. Start gforth
- 类型:
use blocked.fb
(演示页面) - 类型:
1 load
- 键入
editor
-
words
将显示编辑器单词,
- type:
use blocked.fb
(a demo page) - type:
1 load
- type
editor
words
will show the 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,
type 0 l
to list screen 0 which describes the editor,
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
- type:
use blocked.fb
- type:
1 load
- type
editor
然后
- 键入
use myblocks.fb
-
1 load
将显示第1块(第0至15行).每16行包含64个字符) -
1 t
将突出显示第1行 - 输入
i this is text
到[i]插入第1行 - 在编辑当前BLOCK之后,键入
flush
以便将BLOCK#1写入文件myblocks.fb
- type
use myblocks.fb
1 load
will show BLOCK #1 (lines 0 till 15. 16 Lines of 64 characters each)1 t
will highlight line 1- Type
i this is text
to [i]nsert into line 1 - After the current BLOCK is edited type
flush
in order to write BLOCK #1 to the filemyblocks.fb
有关更多信息,请参见 gForth块
For more information see, gForth Blocks
这篇关于GNU FORTH是否有编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文