(docparser:dump (docparser:parse :alexandria))
(require :asdf)
(asdf:system-source-directory :alexandria) #P”home/jacek/quicklisp/dists/quicklisp/software/alexandria-20150505-git”
(asdf:system-source-file :alexandria) #P”/home/jacek/quicklisp/dists/quicklisp/software/alexandria-20150505-git/alexandria.asd”
files of alexandria (multiple-value-bind (ign res) (asdf:operate ‘asdf:load-op ‘alexandria) (defparameter res res)) now res contains interesting data in the system object
this is how we get system object (slot-value res ‘asdf/system:system)
children - list of objects, including files (slot-value (slot-value res ‘asdf/system:system) ‘asdf/system::children)
files of babel - nested src directory (multiple-value-bind (ign res) (asdf:operate ‘asdf:load-op ‘babel) (defparameter res res))
now we have source directory (slot-value (slot-value res ‘asdf/system:system) ‘asdf/system::children) res >> (#<ASDF/COMPONENT:MODULE “babel” “src”>)
and its children (slot-value (first (slot-value (slot-value res ‘asdf/system:system) ‘asdf/system::children)) ‘asdf/system::children)
inspecting children gives me absolute pathnames to the files
this gives me system object without using res (slot-value (multiple-value-bind (ign res) (asdf:operate ‘asdf:load-op ‘babel) (declare (ignore ign)) res) ‘asdf/plan::system)
this gives access to src folder (slot-value (slot-value (multiple-value-bind (ign res) (asdf:operate ‘asdf:load-op ‘babel) (declare (ignore ign)) res) ‘asdf/plan::system) ‘asdf/system::children)
and this will give all files in src directory (slot-value (first (slot-value (slot-value (multiple-value-bind (ign res) (asdf:operate ‘asdf:load-op ‘babel) (declare (ignore ign)) res) ‘asdf/plan::system) ‘asdf/system::children)) ‘asdf/system::children)
sharing same folder
DEAD END
load the system (ql:quickload :quicklisp-xref)
run xref (xref:xref-file “~/Programming/quicklisp-xref/htmlizer.lisp”)
(xref:display-database :arg) where :arg is one of (:FILE :CALLERS :READERS :SETTERS).
getting more info from htmlizer (xref:print-caller-trees :root-nodes ‘(htmlizer))
readers of a symbol (xref:list-readers ‘html-path) => (CL-WHO:STR HTMLIZER)
database (xref:display-database )
trees (xref:print-caller-trees :root-nodes ‘(htmlizer)) => Rooted calling trees: HTMLIZER QL-DIST:ALL-DISTS DIST-HTML-PATH CL-FAD:MERGE-PATHNAMES-AS-FILE QL-DIST:NAME QL-DIST:NAME CL-WHO:WITH-HTML-OUTPUT
more tree info with different symbol (xref:print-caller-trees :root-nodes ‘(cl-who:str))
(sb-introspect:who-calls (quicklisp-xref::htmlizer)) goes though every quicklisp package and fails on some errors
interesting blog: http://farid.hajji.name/blog/2012/03/29/more-ansi-common-lisp-introspection/
sbcl xref??? http://web.mit.edu/jhawk/mnt/spo/clisp/src/sbcl-1.0.23-x86-linux/contrib/sb-introspect/xref-test.lisp
(ql:quickload :trivial-documentation)
(trivial-documentation:symbol-definitions '+)
# result
((:KIND :VARIABLE :VALUE (TRIVIAL-DOCUMENTATION:SYMBOL-DEFINITIONS 'DOTIMES)
:DOCUMENTATION "the value of the most recent top level READ")
(:KIND :FUNCTION :LAMBDA-LIST (&REST SB-KERNEL::NUMBERS) :DOCUMENTATION
"Return the sum of its arguments. With no args, returns 0."))