0

Is there a way to determine what asdf system contains a piece of code? Obviously:

(let ((p *package*))
  (defun get-package ()
    p))

Getting the package that code is compiled under is trivial. What's the equivalent for asdf systems?

I can settle for:

  • A portable way to determine the current source file.
  • A way to determine the source system of a package.
BnMcGn
  • 1,440
  • 8
  • 22
  • Obviously, your package example doesn't do what you think. The value of P is the package during load or eval. – Rainer Joswig Jan 25 '17 at 07:45
  • ASDF has a mailing list : https://mailman.common-lisp.net/listinfo/asdf-devel I would think that the mailing list is the best place for getting an answer. If there is an answer, it would be useful to have it in the FAQ in the ASDF manual. – Rainer Joswig Jan 25 '17 at 08:28
  • 1
    Uiop has a function to get the file being compiled or loaded `(uiop:current-lisp-file-pathname)`. – jkiiski Jan 25 '17 at 09:05
  • 1
    Common Lisp has variables `*compile-file-pathname*` and `*load-pathname*`. – Rainer Joswig Jan 25 '17 at 10:06
  • Rainer: I think that's what I wanted. I want to know, later, what the package was when the file was compiled. Or might load time be different than compile? – BnMcGn Jan 25 '17 at 14:00
  • 1
    Each symbol has package information -> `(symbol-package 'get-package)` -> some-package – Rainer Joswig Jan 25 '17 at 14:18

0 Answers0