关于特定方案/球拍的快速语法问题。显示不带引号的字符串?

发布于 2024-11-08 07:55:33 字数 145 浏览 3 评论 0原文

我正在方案中编写一个程序,最终输出到指定的文件并输出字符串和列表。我正在使用 (display ) 命令,但是当我显示字符串时,它会显示带有引号的内容。例如:“集合”(a (b (cd)))”和“(((dc) b) a)”是相等的。是否可以在不加引号的情况下写入文件?提前致谢

I am writing a program in scheme which eventually outputs to a specified file and outputs both strings and lists. I am using the (display ) command, but when I display a string it shows with quotations around it. EX: "The sets"(a (b (c d)))"and"(((d c) b) a)"are equal." Is it possible to write to file without the quotations? Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蹲墙角沉默 2024-11-15 07:55:33

正如 sepp2k 评论的那样,显示绝对可以满足您的要求。我猜你实际上正在使用其他东西。尽管如此,我可能只会使用“printf”。 EG:

#lang racket

(define a '(a (b (c d))))
(define b '(((d c) b) a))

(printf "The items ~a and ~a are (not actually) equal."
        a b)

...产生输出:

The items (a (b (c d))) and (((d c) b) a) are (not actually) equal.

As sepp2k comments, display definitely does what you want. I'm guessing that you're actually using something else. Be that as it may, I would probably just use "printf" for this. E.G.:

#lang racket

(define a '(a (b (c d))))
(define b '(((d c) b) a))

(printf "The items ~a and ~a are (not actually) equal."
        a b)

... producing output:

The items (a (b (c d))) and (((d c) b) a) are (not actually) equal.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文