如何使用 MIT-Scheme 启动 slimv 的 REPL

2024-01-01

我的操作系统是 Debian Squeeze。这是 vim 版本:

VIM - Vi IMproved 7.2(2008年8月9日,2010年7月12日02:29:33编译)

我读过一篇教程http://kovisoft.bitbucket.org/tutorial.html http://kovisoft.bitbucket.org/tutorial.html并尝试为 MIT-Scheme 启动 REPL。不幸的是,我没能开始。

当我按下“,c”时,它启动了一个加载 mit-scheme 的终端窗口。 vim 的 REPL 缓冲区中没有显示任何内容。终端中显示一些错误:

Listening on port: 4005
;netcat: "4005: inverse host lookup failed: Unknown host"
;To continue, call RESTART with an option number:
; (RESTART 1) => Return to read-eval-print level 1.

2 error> 

我阅读了源代码并修复了一些错误(关于netcat的参数和其他内容),这是diff文件:

*** /home/gaussfrank/slimv/slime/contrib/swank-mit-scheme.scm   2012-02-02 16:41:58.357463955 +0800
--- swank-mit-scheme.scm    2012-02-06 22:30:42.929212874 +0800
***************
*** 113,126 ****

  (define (netcat port)
    (let* ((sh (os/shell-file-name))
!    (cmd (format #f "exec netcat -v -q 0 -l ~a 2>&1" port))
     (netcat (start-pipe-subprocess sh 
                    (vector sh "-c" cmd)
                    scheme-subprocess-environment)))
      (list netcat port)))

  (define (netcat-accept nc)
!   (let* ((rx "^Connection from .+ port .+ accepted$")
     (line (read-line (subprocess-input-port nc)))
     (match (re-string-match rx line)))
      (cond ((not match) (error "netcat:" line))
--- 113,126 ----

  (define (netcat port)
    (let* ((sh (os/shell-file-name))
!    (cmd (format #f "exec netcat -v -q 0 -l -p ~a 2>&1" port))
     (netcat (start-pipe-subprocess sh 
                    (vector sh "-c" cmd)
                    scheme-subprocess-environment)))
      (list netcat port)))

  (define (netcat-accept nc)
!   (let* ((rx "^listening on.*")
     (line (read-line (subprocess-input-port nc)))
     (match (re-string-match rx line)))
      (cond ((not match) (error "netcat:" line))

我重试了,但出现了一些新问题。

;The object #f, passed as the second argument to integer-add, is not the correct type.
;To continue, call RESTART with an option number:
; (RESTART 4) => Specify an argument to use in its place.
; (RESTART 3) => Return to SLIME top-level.
; (RESTART 2) => Close connection.
; (RESTART 1) => Return to read-eval-print level 1.

这是日志文件(swank.log)

[---Sent---] 0.21
(:emacs-rex (swank:connection-info) nil t 1)

[---Sent---] 16.11
(:emacs-rex (swank:swank-require 'swank-fuzzy) nil t 2)

这是数据包:

8   0.739991    127.0.0.1   127.0.0.1   TCP 50732 > pxc-pin [PSH, ACK] Seq=1 Ack=1 Win=32792 Len=51 TSV=1451459 TSER=1451459
0000   00 00 00 00 00 00 00 00 00 00 00 00 08 00 45 00  ..............E.
0010   00 67 91 53 40 00 40 06 ab 3b 7f 00 00 01 7f 00  .g.S@.@..;......
0020   00 01 c6 2c 0f a5 f9 57 b4 93 fc 40 7f 85 80 18  ...,...W...@....
0030   10 03 fe 5b 00 00 01 01 08 0a 00 16 25 c3 00 16  ...[........%...
0040   25 c3 30 30 30 30 32 64 28 3a 65 6d 61 63 73 2d  %.00002d(:emacs-
0050   72 65 78 20 28 73 77 61 6e 6b 3a 63 6f 6e 6e 65  rex (swank:conne
0060   63 74 69 6f 6e 2d 69 6e 66 6f 29 20 6e 69 6c 20  ction-info) nil 
0070   74 20 31 29 0a                                   t 1).

9   0.740009    127.0.0.1   127.0.0.1   TCP pxc-pin > 50732 [ACK] Seq=1 Ack=52 Win=32768 Len=0 TSV=1451459 TSER=1451459
0000   00 00 00 00 00 00 00 00 00 00 00 00 08 00 45 00  ..............E.
0010   00 34 5a 46 40 00 40 06 e2 7b 7f 00 00 01 7f 00  .4ZF@.@..{......
0020   00 01 0f a5 c6 2c fc 40 7f 85 f9 57 b4 c6 80 10  .....,[email protected] /cdn-cgi/l/email-protection....
0030   10 00 fe 28 00 00 01 01 08 0a 00 16 25 c3 00 16  ...(........%...
0040   25 c3                                            %.

这是一个已知问题。我有一个补丁版本 https://github.com/Symaxion/slimv我的 git 存储库中的 Slimv 解决了这个问题以及其他一些问题。

请注意,我很久以前就使用过 Slimv,所以我记不清我做了哪些具体的更改。我只在 OS X 上测试过这个,所以 YMMV。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使用 MIT-Scheme 启动 slimv 的 REPL 的相关文章

  • vim 中项目列表的智能硬包装

    我喜欢 vim 而且我真的很喜欢在写文字时将它们硬包装起来 Tim Pope 的 markdown 插件很棒 并且构建得当我尝试硬包装项目列表时它可以正确完成工作 好吧 这就是我所说的正确完成工作的意思 here I write a lon
  • 为 Vim 命令行创建一个映射,在插入寄存器之前转义寄存器的内容

    假设我有一个这样的文档 并且我想搜索所有出现的 URL Vim resources http example com search q vim q q http example com search q vim 我不想完整地输入它 所以我将
  • 大括号 {} 替换 Racket 中的“开始”

    是否可以有一个宏 使用大括号 来表示一个语句块 从而替换 begin 关键字 因此 代替 if condition begin statement1 statement2 statement3 statement4 else stateme
  • 使用 cscope 在头文件和实现文件之间切换的 Vim 脚本

    我目前使用的是A vim http vim wikia com wiki Easily switch between source and header file在头文件和实现文件之间交换的插件 该脚本的局限性在于 它仅在两者位于同一文件夹
  • vim可以实时监控文件的变化吗

    我的问题与此类似如何实时监控文本文件 https stackoverflow com questions 18632 how to monitor a text file in realtime但我想在vim中做 我知道我可以读取打开的文件
  • Vim:用字符填充行

    如何在一行或多行末尾重复添加字符 将行填充到特定列 例如 x 代表第 40 列 不是该行上的字符 并且文本后没有空格或制表符 line one x line two x line three x line eleventy billion
  • 使用 Webpack 波形符别名时通过 Vim 中的“gf”解析 JavaScript 模块

    我是使用波浪号的 Vue js 项目的新成员 模块导入中的符号 如 import WhateverApi from api whatever 项目存储库包含所有类型的文件 Vagrant 机器 Laravel 后端应用程序 配置文件和 Vu
  • Vim - 删除多行中的直到(包括)字符

    我有这个代码 def foo c Char c match case a B 我的光标位于后面的空格上 我想删除所有内容 直到 包括 我怎样才能做到这一点 我可以在光标位于第一行任意位置时执行相同操作吗 块中的任何位置 并将光标放在 d e
  • Vim NerdCommenter:在 vimrc 中添加新文件类型

    有没有办法在 vimrc 中为 NerdCommenter 定义新的文件类型注释 它已经可以工作了 但是如果我可以将其直接放入 vimrc 中 备份配置会更容易 Thanks NERDCommenter 能够解析commentstring选
  • 方案语言:合并两个数字

    如何将列表中的两个整数合并为一个 方案中 例子 11 223 gt 11223 假设列表恰好有两个元素 并且都是数字 define merge numbers lst let 1st number gt string first lst 2
  • vim:视觉明星搜索未按预期工作

    我复制了这个函数来进行视觉搜索 and function s VSetSearch cmdtype let temp s norm gv sy let V substitute escape s a cmdtype n n g let s
  • 如何更改每种语言的 vim 设置?

    我将 vim 与许多不同的语言 C C Java shell 等 一起使用 我知道 vim 已经为每种语言预设了设置 但我想根据我个人的喜好更改每种语言的设置 我已经有一个带有设置的 vimrc 文件 但我想要更多文件来根据我使用的语言声明
  • 当vim进入可视模式时运行命令

    我使用一个小脚本来触发插入模式以更改行号颜色 function CursorLineNrColorInsert mode Insert mode blue if a mode i highlight CursorLineNr ctermfg
  • 如何在 Vim 中转置文件中的行和列的内容?

    我知道我可以使用 Awk 但我使用的是 Windows 机器 并且我正在为可能没有 Awk 的其他人创建一个函数 我也知道我可以编写 C 程序 但我不希望我正在制作的 Vim 实用程序需要编译和维护 原始文件可能是 THE DAY WAS
  • Letrec 和可重入延续

    有人告诉我 以下表达式的计算结果为 0 但许多方案的实现将其计算为 1 let cont f letrec x call with current continuation lambda c set cont c 0 y call with
  • 如何在 Vim 中从命令行模式复制文本?

    比如说 我刚刚在 Vim 中运行了这个命令 nmap
  • vim - 如何删除 netrw?

    我正在测试https github com skwp dotfiles https github com skwp dotfiles 不幸的是它确实安装了很多我不想要的东西 例如 现在 使用空的 vimrc 当我打开 vim 时 我得到 N
  • Pathogen 不加载插件

    病原体对我不起作用 我正在遵循 Adam Lowe 发布的提示here http www adamlowe me 2009 12 vim destroys all other rails editors html 还有更多 没有任何成功 我
  • 运行 tmux 时映射箭头键

    这些键映射在 tmux 中停止工作 在我的 vimrc 我有 nmap
  • 使用 vim 重构目录中的类/方法/字符串的有效方法

    到目前为止 我一直在使用查找和替换操作手动重构代码 s stringiwanttoreplace newstring g in vim 但这是一个缓慢而费力的过程 如果我有的话字符串我想更换在特定目录内的许多文件中 我当前 典型的缓慢而费力

随机推荐