【问题标题】:write newline in a file using R5RS scheme使用 R5RS 方案在文件中写入换行符
【发布时间】:2010-11-10 18:58:26
【问题描述】:

我一直在寻找一种在文件中写入换行符的方法 我必须使用 R5RS,我在上一个问题(换行端口)中看到,但这在这个版本中不起作用,\n,

有什么想法吗?

所有内容都写在一行中 (写“你好”p) (写“w”p)

给我一​​个带有 hellop 的文件

【问题讨论】:

  • 您能具体说明您使用的是哪个Scheme系统吗?

标签: scheme r5rs


【解决方案1】:

如果您的 I/O 函数不允许您指定端口,您可以改用 with-output-to-file

(with-output-to-file "test.out"
  (lambda ()
    (display "Hello, world!")
    (newline)))

【讨论】:

    猜你喜欢
    • 2019-03-25
    • 2016-05-13
    • 1970-01-01
    • 1970-01-01
    • 2022-11-20
    • 2017-03-23
    • 1970-01-01
    • 2014-01-25
    • 1970-01-01
    相关资源
    最近更新 更多