GNU FORTH是否有编辑器? [英] Does GNU FORTH have an editor?

查看:96
本文介绍了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. Unlike LIST, 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

  1. 类型:use blocked.fb(演示页面)
  2. 类型:1 load
  3. 键入editor
  4. words将显示编辑器单词,

  1. type: use blocked.fb (a demo page)
  2. type: 1 load
  3. type editor
  4. 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

    1. 类型:use blocked.fb
    2. 类型:1 load
    3. 键入editor
    1. type: use blocked.fb
    2. type: 1 load
    3. type editor

    然后

    1. 键入use myblocks.fb
    2. 1 load将显示第1块(第0至15行).每16行包含64个字符)
    3. 1 t将突出显示第1行
    4. 输入i this is text到[i]插入第1行
    5. 在编辑当前BLOCK之后,键入flush以便将BLOCK#1写入文件myblocks.fb
    1. type use myblocks.fb
    2. 1 load will show BLOCK #1 (lines 0 till 15. 16 Lines of 64 characters each)
    3. 1 t will highlight line 1
    4. Type i this is text to [i]nsert into line 1
    5. After the current BLOCK is edited type flush in order to write BLOCK #1 to the file myblocks.fb

    有关更多信息,请参见 gForth块

    For more information see, gForth Blocks

    这篇关于GNU FORTH是否有编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆