- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何告诉 ASDF 仅在组件文件存在时才处理该组件文件(以便在组件文件尚不存在时不会生成错误)。
(asdf:defsystem "my-system"
:components ((:file "utilities")
(:file "temp-file" :depends-on ("utilities"))))
我的解决方法是使用读取器宏#。在 (probe-file "temp-file")
上,但无法使其工作。
最佳答案
我认为你真正想做的是让 ASDF 只是警告你,而不是在编译错误期间启动调试器。更改 *compile-file-warnings-behaviour*
和 *compile-file-failure-behaviour*
,并读取 the section on error handling在手册中。
这个答案的其余部分是如何检查整个系统。您可以将可能要加载的文件打包到它们自己的系统中,并按照下面的方式执行此操作。
6.3.8 Weakly depends on
We do NOT recommend you use this feature.
所以你无论如何都可以使用它。像这样:
(defpackage :foo-system
(:use :cl :asdf))
(in-package :foo-system)
(defsystem foo
:description "The main package that maybe loads bar if it exists."
:weakly-depends-on (:bar)
:components ((:file "foo")))
简单吧?
以下是他们的建议:
If you are tempted to write a system foo that weakly-depends-on a system bar, we recommend that you should instead write system foo in a parametric way, and offer some special variable and/or some hook to specialize its behaviour; then you should write a system foo+bar that does the hooking of things together.
我从未在野外见过其中的一个,可能是因为这样做会造成可怕的困惑。
(defpackage :bar-system
(:use :cl :asdf))
(in-package :bar-system)
(defsystem bar
:description "The package that maybe exists and is needed by foo."
:components ((:file "bar")))
(defpackage :foo+bar-system
(:use :cl :asdf))
(in-package :foo+bar-system)
(defsystem foo+bar
:version "0.1.0"
:description "Hook together foo and bar."
:author "Spenser Truex <web@spensertruex.com>"
:serial t
:components ((:file "foo+bar")))
(defpackage :foo-system
(:use :cl :asdf))
(in-package :foo-system)
(defsystem foo
:description "The main package that maybe loads bar if it exists."
:depends-on (:foo+bar)
:components ((:file "foo")))
关于common-lisp - 使用 ASDF 加载可选组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56483597/
我正在尝试用 Swift 编写这段 JavaScript 代码:k_combinations 到目前为止,我在 Swift 中有这个: import Foundation import Cocoa e
我是一名优秀的程序员,十分优秀!