[asdf-devel] Loading an .asd file directly using its pathname

Luís Oliveira luismbo at gmail.com
Mon Jun 24 17:11:46 UTC 2013


Hello,

Given a pathname to an .asd file, I sometimes load it using this hack:

  (defun load-asd (path &rest options)
    (let ((asdf:*system-definition-search-functions*
           (cons (lambda (system)
                   (when (string= (asdf::coerce-name system) (pathname-name path))
                     path))
                 asdf:*system-definition-search-functions*)))
      (apply #'asdf:load-system (pathname-name path) options)))


Other times I use:

   (let ((asdf:*central-registry* (cons <directory-where-my-asd-lives>
                                        asdf:*central-registry*)))
     (asdf:load-system :some-system))


Also, I see that the slime-asdf contrib uses this definition:

  (defun load-asd (pathname &key name &allow-other-keys)
    (asdf::load-sysdef (or name (string-downcase (pathname-name pathname)))
                       pathname))


I wonder if ASDF could export LOAD-SYSDEF or perhaps have
ASDF:LOAD-SYSTEM accept a pathname in addition to what it currently
accepts.

Cheers,

-- 
Luís Oliveira
http://kerno.org/~luis/




More information about the asdf-devel mailing list