我在代码中使用了很多循环列表,并希望在加载文件时自动将*print-circle*设置为t。我将行(setf *print-circle* t)添加到我的文件中,并认为这会有所帮助。
但是,当我使用C将文件加载到粘液中时,这似乎不起作用--如果我试图使用加载的代码打印循环列表,则除非在加载后手动将(setf *print-circle* t)输入到REPL中,否则REPL将被抛到一个无限循环中。我不知道为什么会发生这种情况--我只是在开始使用适当的包装和黏液之后才开始有这种行为。
为了记录在案,我的包声明(以及我认为可能相关的任何其他声明)如下:
(eval-when (:compile-toplevel :load-toplevel :execute)
(ql:quickload "priority-queue")
(load "utilities.fasl")) ;;to avoid compilation issues
(defpackage :tournament
(:use :cl :priority-queue :utilities))
(in-package :tournament)
(setf *print-circle* t) ;should work, but doesn't我遗漏了什么?
发布于 2014-05-19 10:00:22
您需要将*print-circle*的设置包装在eval-when中。
(eval-when (:load-toplevel :execute)
(setq *print-circle* t))https://stackoverflow.com/questions/23705170
复制相似问题