Changeset 13682


Ignore:
Timestamp:
10/28/11 08:19:45 (9 years ago)
Author:
Mark Evenson
Message:

First plausible implementation of docstring groveling (unfinished).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/doc/manual/grovel.lisp

    r13680 r13682  
    33  (with-open-file (stream "java.tex" :direction :output)
    44    (loop :for symbol :being :each :external-symbol :of package
    5        :collecting (symbol-tex symbol))))
     5       :collecting (symbol-as-tex symbol))))
    66
    77(asdf:load-system 'swank) ;; XXX Does this load the SWANK-BACKEND package as well
    88
     9(defun arglist-as-string (symbol)
     10  (loop :for arg :in (arglist symbol)
     11     :collecting (format nil "~A" (symbol-name arg))))
     12
     13(defvar *type-alist*
     14  '((:function . "Function")
     15    (:macro . "Macro")
     16    (:variable . "Variable")
     17    (:generic-function . "Generic Function")))
     18
    919(defun symbol-as-tex (symbol)
    10   "Return the TeX representation of a SYMBOL as a string."
    11   (let (type documentation arglist
    12              (doc (swank-backend:describe-symbol-for-emacs symbol)))
    13     (cond ((find :function doc)
     20  "Return the TeX representation of a SYMBOL as Tex."
     21  (let (type documentation arglist doc)
     22    (when (setf doc (swank-backend:describe-symbol-for-emacs symbol))
     23        (cond
     24          ((find :function doc)
    1425           (setf type :function
    15                  documentation (second doc)))
     26                 documentation (second doc)
     27                 arglist (arglist-as-string symbol)))
    1628          ((find :variable doc)
    1729           (setf type :variable
     30                 documentation (second doc)))
     31          ((find :macro doc)
     32           (setf type :macro
     33                 documentation (second doc)))
     34          ((find :generic-function doc)
     35           (setf type :generic-function
    1836                 documentation (second doc))))
    19     (warn "Unfinished implementation.")))
     37        (format nil "\\ref{~A:~A}~&--- ~A [\\textbf{~A}]: ~A"
     38                (symbol-name symbol)
     39                (package-name (symbol-package symbol))
     40                (cdr (assoc type *type-alist*))
     41                (symbol-name symbol)
     42                (package-name (symbol-package symbol))))))
     43               
     44
     45
     46
    2047 
    2148         
Note: See TracChangeset for help on using the changeset viewer.