I'm attempting to save the output of (ql:system-apropos "regex")
to a variable by using multiple-value-bind
, but I only the nil
. However, it seems that this command only prints text to REPL and does not return any variables, so doesn't seem to work. In that case, is there any way to get the output of ql:system-apropos
as a list or as an array, especially the package names returned by it.
This basic multiple-value-bind
code works:
* (multiple-value-bind (first-var second-var) (floor 5 3) (defparameter *first-var* first-var) (defparameter *second-var* second-var))
*SECOND-VAR*
* *first-var*
1
* *second-var*
2
*
But this does not (if there is nothing to bind for multiple-value-bind
?) :
* (multiple-value-bind (first-var second-var) (ql:system-apropos "regex") (defparameter *first-var* first-var) (defparameter *second-var* second-var))
#<SYSTEM com.informatimago.common-lisp.regexp / com.informatimago-20120407-git / quicklisp 2012-04-07>
#<SYSTEM lispbuilder-regex / lispbuilder-20110619-svn / quicklisp 2012-04-07>
#<SYSTEM recursive-regex / recursive-regex-20120407-git / quicklisp 2012-04-07>
#<SYSTEM recursive-regex-test / recursive-regex-20120407-git / quicklisp 2012-04-07>
#<SYSTEM regex / regex-1 / quicklisp 2012-04-07>
*SECOND-VAR*
* *first-var*
NIL
* *second-var*
NIL
*
So it seems that ql:system-apropos
only prints text on screen by using format
or some other printing command?
The purpose of this would be to extract the package names of output by using some string handling commands (probably some regex) and automate the installing or re-installing of all packages returned by ql:system-apropos
, for example:
(defparameter *package-name-string* "lispbuilder")
(multiple-value-bind (lispbuilder-packages-list) (ql:system-apropos *package-name-string*) (defparameter *lispbuilder-packages-list* lispbuilder-packages-list))
Any other way to get quicklisp
package names using partial names or some regex as input would also be a working solution (even getting the current complete list of packages would be useful). Is there any viable solution to do this?