scheme - GNU 方案输出

标签 scheme gnu

我想保存在 GNU/scheme 上运行的任何编程的结果。为了做到这一点,我准备了以下测试文件(请参见下文)。我想通过运行这个,一个只包含单词“01234”的 scm 文件将被保存在名为“testfile”的相关目录中,但我找不到任何文件,尽管 GNU 方案在运行这个后说“完成”程序。有人能告诉我这有什么问题吗?我正在 Windows 上运行 GNU 方案(从下载;http://www.gnu.org/software/mit-scheme/“我安装了 Windows 二进制文件” )和我的电脑上我认为将保存该文件的目录是; C:\Program Files (x86)\MIT-GNU 方案

下面是测试程序的内容

(define outport (open-output-file "testfile"))  
(display "abcde" outport)  
(newline outport)  
(display "01234" outport)  
(newline outport)  
(close-output-port outport)

谢谢。

最佳答案

乌塞尔帕的解释是正确的。

手册中有以下内容:

15.2 Working Directory

When MIT/GNU Scheme is started, the current working directory (or simply, working directory) is initialized in an operating-system dependent manner; usually, it is the directory in which Scheme was invoked. The working directory can be determined from within Scheme by calling the pwd procedure, and changed by calling the cd procedure. Each REP loop has its own working directory, and inferior REP loops initialize their working directory from the value in effect in their superior at the time they are created.

这意味着您可以使用

(pwd)

在Scheme repl 中查看文件的保存位置。

关于scheme - GNU 方案输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34706701/

相关文章:

c++ - std::cout operator<< 的奇怪行为

recursion - 替换列表中每个出现的元素,仅当它跟在指定元素之后时

linux - 具有多个参数的 Gnu Parallel - 选择性命令执行

bash - 如何在 Bash 中为 GNU Parallel 创建 Stack 或 LIFO

scheme - 尾递归中的反向输出

c - Unix 命令行提示符下的 GNU 并行设置

c - 如何在 C 中用逗号格式化货币?

scheme - 循环形式的命名 let 是如何工作的?

scheme - 在 Racket/Scheme 中使用 local

garbage-collection - Gambit-C 的 GC 机制是什么?