windows上怎么emacs配置 chez scheme

从 chez scheme 的 github release 下载 windows 安装版

安装后 添加环境变量后

命令行下已经有了 scheme 和 pettie

 scheme --help
usage: C:\Program Files\Chez Scheme 9.5.8\bin\ta6nt\scheme.exe [options and files]
options:
  -q, --quiet                             suppress greeting and prompt
  --script <path>                         run as shell script
  --program <path>                        run rnrs program as shell script
  --libdirs <dir>;...                     set library directories
  --libexts <ext>;...                     set library extensions
  --compile-imported-libraries            compile libraries before loading
  --import-notify                         enable import search messages
  --optimize-level <0 | 1 | 2 | 3>        set optimize-level
  --debug-on-exception                    on uncaught exception, call debug
  --eedisable                             disable expression editor
  --eehistory <off | path>                expression-editor history file
  --enable-object-counts                  have collector maintain object counts
  --retain-static-relocation              keep reloc info for compute-size, etc.
  -b <path>, --boot <path>                load boot file
  --verbose                               trace boot/heap search process
  --version                               print version and exit
  --help                                  print help and exit
  --                                      pass through remaining args

 petite --help
usage: C:\Program Files\Chez Scheme 9.5.8\bin\ta6nt\petite.exe [options and files]
options:
  -q, --quiet                             suppress greeting and prompt
  --script <path>                         run as shell script
  --program <path>                        run rnrs program as shell script
  --libdirs <dir>;...                     set library directories
  --libexts <ext>;...                     set library extensions
  --compile-imported-libraries            compile libraries before loading
  --import-notify                         enable import search messages
  --optimize-level <0 | 1 | 2 | 3>        set optimize-level
  --debug-on-exception                    on uncaught exception, call debug
  --eedisable                             disable expression editor
  --eehistory <off | path>                expression-editor history file
  --enable-object-counts                  have collector maintain object counts
  --retain-static-relocation              keep reloc info for compute-size, etc.
  -b <path>, --boot <path>                load boot file
  --verbose                               trace boot/heap search process
  --version                               print version and exit
  --help                                  print help and exit
  --                                      pass through remaining args

已经在 emacs 中尝试过

(setq scheme-program-name "scheme.exe")
;run-scheme 报 apply: Searching for program: No such file or directory, scheme.exe

(setq scheme-program-name "petite.exe")
;run-scheme 报 apply: Searching for program: No such file or directory, petite.exe

(setq scheme-program-name "C:/Program Files/Chez Scheme 9.5.8/bin/ta6nt/scheme.exe --program")
;但 run-scheme 报 apply: Spawning child process: Invalid argument

(setq scheme-program-name "C:/Program Files/Chez Scheme 9.5.8/bin/ta6nt/petite.exe")
;run-scheme 报 apply: Spawning child process: Invalid argument

不知道有没有人知道怎么解决

直接用 https://racket-lang.org/ ,和 racket-mode

其实还不明白 racket 与 scheme 区别,看 sicp 是 scheme的,就干了scheme

我开始也不知道。 racket 是 scheme 语言的一个实现。

加上 .bat

On a Windows 95/98/ME system, you may have to use “petite.bat” or even “c:/windows/petite.bat” in place of “petite”.

https://www.scheme.com/emacs/index.html

1 个赞

我安装没有 petite.bat 文件,只有 petite.exe

那就是因为你的路径里有空格

改成 "C:/Program\\ Files/Chez\\ Scheme\\ 9.5.8/bin/ta6nt/petite.exe"

(add-to-list 'exec-path "C:\\Program Files\\Chez Scheme 9.5\\bin\\ta6nt")
(add-to-list 'load-path "C:\\Program Files\\Chez Scheme 9.5\\bin\\ta6nt")

(setq scheme-program-name "scheme")

有效 参考 windows系统下scheme语言编程环境的搭建