Skip to content

Commit

Permalink
GE:AUTODOC is closer to fine.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich Loveland committed Feb 13, 2015
1 parent 5ba2cb5 commit a485e15
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions scheme/scsh/geiser/doc.scm
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
(define (signature id args-list)
(let ((value (ge:symbol->object id)))
(if value
(let ((args (vector-ref value 0))
(proc (vector-ref value 1)))
(let ((args (second (first value)))
(proc (second value)))
(cons proc
(list (cons "args" `(("required" ,args)
("optional")
Expand Down
2 changes: 2 additions & 0 deletions scheme/scsh/geiser/packages.scm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
big-util
re-old-funs
formats
meta-types
disclosers
sorting
packages
command-processor)
Expand Down
18 changes: 15 additions & 3 deletions scheme/scsh/geiser/utils.scm
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,23 @@
;; not, see <http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5>.

(define (ge:symbol->object sym)
(and (symbol? sym)
(ge:bound? sym)))
(cond ((symbol? sym)
(ge:bound? sym))
((procedure? sym)
(let ((qsym (quote sym)))
(ge:bound? qsym)))))

;; ,open meta-types disclosers
(define (ge:bound? name)
(package-lookup (environment-for-commands) name))
(let ((val (package-lookup (environment-for-commands) name)))
(if val
(let* ((type (vector-ref val 0))
(loc (vector-ref val 1))
(junk (vector-ref val 2))
(ptype (type->sexp type #f))
(ploc (location-name loc)))
(list ptype ploc junk))
#f)))

(define (ge:pair->list pair)
(let loop ((d pair) (s '()))
Expand Down

0 comments on commit a485e15

Please sign in to comment.