在Scheme中是否有Common Lisp的*print-circle*的等价物?

发布于 2024-09-26 01:03:47 字数 491 浏览 0 评论 0原文

我正在Scheme(SICP练习3.23)中研究双端队列,并且我有一个简单的双向链表实现,我想测试一下,但我似乎不知道如何在中打印出循环列表方案(mit-scheme 和 mzscheme/racket)。

在CL中有一个标志print-circle用于此类事情,Scheme中是否有等效的东西?我已经尝试过“with-output-to-truncated-string”,但这似乎在我从 Macports 获得的 mit-scheme 版本中不可用,尽管我认为它应该是?有什么方法可以在 REPL 上获取此过程吗?我需要包含一些内容吗?

http://sicp.ai.mit .edu/Fall-2003/manuals/scheme-7.5.5/doc/scheme_15.html

谢谢!

I'm working on a deque in Scheme (SICP exercise 3.23) and I've got a simple doubly-linked list implementation I would like to test out, but I can't seem to find out how to print out a circular list in Scheme (mit-scheme and mzscheme/racket).

In CL there is a flag print-circle for this sort of thing, is there anything equivalent in Scheme? I've tried "with-output-to-truncated-string" but that doesn't seem to be available in the build of mit-scheme I got from Macports although I think it should be? Is there some way of getting this procedure at the REPL, do I need to include something?

http://sicp.ai.mit.edu/Fall-2003/manuals/scheme-7.5.5/doc/scheme_15.html

Thanks!

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

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

发布评论

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

评论(1

只是我以为 2024-10-03 01:03:47

没有任何标准可以做到这一点,但大多数方案实现都会有某种方法来控制其打印机。在 Racket 案例中,有 print-graph 参数执行此操作。但另请参阅 Racket 的 SICP 支持包,这将使您的 SICP 生活更加轻松。

There is nothing standard to do this, but most Scheme implementations will have some way to control their printers. In the Racket case, there is the print-graph parameter that does it. But see also the SICP support package for Racket, which should make your life with SICP much easier.

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