GNU FORTH 有编辑器吗?

Eva*_*oll 2 forth gforth

开始 FORTH 的第 3 章说,

现在您已经创建了一个“当前”块,您可以通过简单地输入单词来列出它L。与 不同LISTL不希望按块号进行处理;相反,它列出了当前块。

当我跑步时180 LIST,我得到

Screen 180 not modified     
0                                                                 
...                                                             
15                                                                 
 ok
Run Code Online (Sandbox Code Playgroud)

但是当我运行时L,我收到一个错误

:30: Undefined word
>>>L<<<
Backtrace:
$7F0876E99A68 throw 
$7F0876EAFDE0 no.extensions 
$7F0876E99D28 interpreter-notfound1 
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

小智 8

是的,gForth 支持内部 (BLOCK) 编辑器。开始前进

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

    s b n bx nx qx dl il f y r d i t 'par 'line 'rest c a m  ok
    
    Run Code Online (Sandbox Code Playgroud)
  5. 键入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
    
    Run Code Online (Sandbox Code Playgroud)

创建自己的块文件

创建您自己的新块文件 myblocks.fb

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

然后

  1. 类型 use myblocks.fb
  2. 1 load 将显示 BLOCK #1(第 0 行到第 15 行。16 行,每行 64 个字符)
  3. 1 t 将突出显示第 1 行
  4. 键入i this is text到[I] nsert成1行
  5. 在当前 BLOCK 被编辑类型flush以将 BLOCK #1 写入文件后myblocks.fb

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