문제

Among other things you can set in an ASDF system is the :version property. Is there a way to read it at runtime? Something like (system-version :my-system-name)?

I know there are asdf:version-satisfies, and asdf:asdf-version, but neither do what I want in this case.

도움이 되었습니까?

해결책

Here is the code:

(defun system-version (system-designator)
  (let ((system (asdf:find-system system-designator nil)))
    (when (and system (slot-boundp system 'asdf:version))
      (asdf:component-version system))))

it works like this:

CL-USER> (system-version :cffi)
"0.10.7.1"
CL-USER> (system-version :foo)
NIL
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top