xtmdoc-documentation-function   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/llvmti.xtm

Implementation

(define xtmdoc-documentation-function
  (lambda (name)
    (let ((sym (string->symbol name)))
      (cond ((impc:ti:builtin-exists? name)
             (cons 'xtmdoc-docstring (xtmdoc-builtin-handler sym)))
            ((impc:ti:typealias-exists? name)
             (cons 'xtmdoc-docstring (xtmdoc-typealias-handler sym)))
            ((impc:ti:genericfunc-exists? name)
             (cons 'xtmdoc-docstring (xtmdoc-genericfunc-handler sym)))
            ((impc:ti:polyfunc-exists? name)
             (cons 'xtmdoc-docstring (xtmdoc-polyfunc-handler sym)))
            ((impc:ti:closure-exists? name)
             (cons 'xtmdoc-docstring (xtmdoc-closure-handler sym)))
            ((impc:ti:nativefunc-exists? name)
             (cons 'xtmdoc-docstring (xtmdoc-nativefunc-handler sym)))
            ((impc:ti:globalvar-exists? name)
             (cons 'xtmdoc-docstring (xtmdoc-globalvar-handler sym)))
            ((impc:ti:generictype-exists? name)
             (cons 'xtmdoc-docstring (xtmdoc-generictype-handler sym)))
            ((impc:ti:polytype-exists? name)
             (cons 'xtmdoc-docstring (xtmdoc-polytype-handler sym)))
            ((impc:ti:namedtype-exists? name)
             (cons 'xtmdoc-docstring (xtmdoc-namedtype-handler sym)))
            ((and (defined? sym) (closure? (eval sym)))
             (cons 'xtmdoc-docstring (xtmdoc-scheme-function-handler sym)))
            ((and (defined? sym) (macro? (eval sym)))
             (cons 'xtmdoc-docstring (xtmdoc-scheme-macro-handler sym)))
            (else
             '(xtmdoc-docstring-nodocstring))))))


Back to Index