Domanda

Everytime I install a system via Quicklisp, i always find myself searching for the name of essential package, which an average user will be interested because it exports the 'final product' API to be played with. Thus anyone needs to know its name and issue the command on REPL:

(use-package :package)

in order to play with it on REPL.

Is there a quick and easy way to determine the packages contained by a system loaded by Quicklisp without searching archaic documentation.

È stato utile?

Soluzione

You can list all packages with LIST-ALL-PACKAGES.

If you keep them before and after loading software, you can compare them.

CL-USER 14 > (setf *print-length* 10)
10

CL-USER 15 > (list-all-packages)
(#<The SQL-COMMON package, 0/4 internal, 28/32 external> #<The QL-LISPWORKS package, 0/16 internal, 5/16 external> #<The QL-SETUP package, 25/32 internal, 3/16 external> #<The QL-ALLEGRO package, 0/16 internal, 6/16 external> #<The QL-DIST package, 110/256 internal, 81/256 external> #<The COMM package, 1053/4096 internal, 949/1024 external> #<The MP package, 921/1024 internal, 209/256 external> #<The REG package, 41/64 internal, 0/4 external> #<The LOOP package, 247/256 internal, 3/4 external> #<The QL-DIST-USER package, 0/16 internal, 0/16 external> ...)

CL-USER 16 > (defpackage "FOO")
#<The FOO package, 0/16 internal, 0/16 external>

CL-USER 17 > (list-all-packages)
(#<The SQL-COMMON package, 0/4 internal, 28/32 external> #<The QL-LISPWORKS package, 0/16 internal, 5/16 external> #<The QL-SETUP package, 25/32 internal, 3/16 external> #<The QL-ALLEGRO package, 0/16 internal, 6/16 external> #<The QL-DIST package, 110/256 internal, 81/256 external> #<The COMM package, 1053/4096 internal, 949/1024 external> #<The MP package, 921/1024 internal, 209/256 external> #<The REG package, 41/64 internal, 0/4 external> #<The LOOP package, 247/256 internal, 3/4 external> #<The QL-DIST-USER package, 0/16 internal, 0/16 external> ...)

CL-USER 18 > (set-difference * ***)
(#<The FOO package, 0/16 internal, 0/16 external>)

So you found that between two package listings, there was a package FOO introduced.

Also note that USE-PACKAGE is not necessarily a useful thing. USE-PACKAGE imports the exported symbols into your current package. This may or may not work. It can lead to arbitrary symbol name clashes.

Altri suggerimenti

No, there isn't. In general, you can't load a project without reading its documentation to know how to use it.

Unfortunately, sometimes the only documentation is the code itself. Slime helps explore code with M-. but you do have to know where to start.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top