gpt4 book ai didi

forth - GNU FORTH 有编辑器吗?

转载 作者:行者123 更新时间:2023-12-01 16:09:30 27 4
gpt4 key购买 nike

第 3 章 Starting FORTH说,

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 时,我得到一个错误

:30: Undefined word
>>>L<<<
Backtrace:
$7F0876E99A68 throw
$7F0876EAFDE0 no.extensions
$7F0876E99D28 interpreter-notfound1

我做错了什么?

最佳答案

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

  1. 类型:使用 blocked.fb(演示页面)
  2. 类型:1 次加载
  3. 输入编辑器
  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

创建自己的 block 文件

创建自己的新 block 文件 myblocks.fb

  1. 类型:使用 blocked.fb
  2. 类型:1 次加载
  3. 输入编辑器

然后

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

有关详细信息,请参阅 gForth Blocks

关于forth - GNU FORTH 有编辑器吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48837115/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com