LispCookbook / LispCookbook/cl-cookbook
Mention (recommend?) ASDF package-inferred-system
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 158
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 2
Description
Package-inferred-system have multiple benefits over the older way:
- No need to list the files to compile.
- No need to list the dependencies, ASDF will figure them out from the package `import`s.
If someone wants to have a list of all dependencies actually used by the system, the following function can do:
```
(defun system-depends-on (system)
"List SYSTEM dependencies, even if SYSTEM is an inferred system.
From: https://gitlab.common-lisp.net/asdf/asdf/issues/10#note_5018."
(let (depends)
(labels ((iter (openlist)
(if (null openlist) depends
;; Is this a subsystem of SYSTEM?
(let ((find (search system (first openlist))))
(if (and find (zerop find))
(iter (append (asdf:system-depends-on (asdf:find-system (first openlist))) (rest openlist)))
;; If not, it's a direct dependency: collect it.
(progn
(pushnew (first openlist) depends :test 'equalp)
(iter (rest openlist))))))))
(iter (list system)))))
```
Contributor guide
Research direction
No file or test is named. Begin by locating the cookbook section covering ASDF system definitions, then determine whether the package-inferred-system benefits and dependency-listing example belong there; the work is done when the guidance is added or its recommendation is clearly resolved.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100