Next: , Previous: , Up: What has changed between ASDF 1 ASDF 2 and ASDF 3?   [Contents][Index]


13.3.2 How do I detect the ASDF version?

All releases of ASDF push :asdf onto *features*. Releases starting with ASDF 2 push :asdf2 onto *features*. Releases starting with ASDF 3 (including 2.27 and later pre-releases) push :asdf3 onto *features*. Furthermore, releases starting with ASDF 3.1.2 (May 2014), though they count as ASDF 3, include enough progress that they also push :asdf3.1 onto *features*. You may depend on the presence or absence of these features to write code that takes advantage of recent ASDF functionality but still works on older versions, or at least detects the old version and signals an error.

Additionally, all releases starting with ASDF 2 define a function (asdf:asdf-version) you may use to query the version. All releases starting with 2.013 display the version number prominently on the second line of the asdf.lisp source file.

If you are experiencing problems or limitations of any sort with ASDF 1 or ASDF 2, we recommend that you should upgrade to the latest release, be it ASDF 3 or other.

Finally, here is a code snippet to programmatically determine what version of ASDF is loaded, if any, that works on all versions including very old ones:

(when (find-package :asdf)
  (let ((ver (symbol-value
                   (or (find-symbol (string :*asdf-version*) :asdf)
                       (find-symbol (string :*asdf-revision*) :asdf)))))
    (etypecase ver
      (string ver)
      (cons (with-output-to-string (s)
              (loop for (n . m) on ver
                    do (princ n s)
                       (when m (princ "." s)))))
      (null "1.0"))))

If it returns nil then ASDF is not installed. Otherwise it should return a string. If it returns "1.0", then it can actually be any version before 1.77 or so, or some buggy variant of 1.x. If it returns anything older than "3.0.1", you really need to upgrade your implementation or at least upgrade its ASDF. See 処理系付属のASDFを置き換える.


Next: , Previous: , Up: What has changed between ASDF 1 ASDF 2 and ASDF 3?   [Contents][Index]