GNU FORTH有编辑吗?

时间:2018-02-17 01:42:20

标签: forth gforth

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 

我做错了什么?

4 个答案:

答案 0 :(得分:1)

事实证明这些是“编辑命令”,这本书说,

  

对于那些编辑不遵守这些规则的人

     

FORTH-79标准不指定编辑器命令。您的系统可能使用不同的编辑器;如果是这样,请检查您的系统文档

我不相信gforth完全支持内部编辑器。因此LTIPFEDR都是可能没有支持。

答案 1 :(得分:1)

gforth与emacs完美集成。在我的xemacs中,默认情况下,任何名为* .fs的文件都被视为FORTH源。像往常一样,“C-h m”给出了可用的命令。

答案 2 :(得分:1)

是的,gForth支持内部(BLOCK)编辑器。启动gforth

  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
    
  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
    

创建自己的阻止文件

要创建自己的新阻止文件myblocks.fb

  1. 类型:use blocked.fb
  2. 类型:1 load
  3. 键入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

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

答案 3 :(得分:0)

不,GNU Forth没有内部编辑器;我用Vim :)