xtmdoc-polyfunc-handler   scheme


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

Implementation

(define xtmdoc-polyfunc-handler
  (lambda (name-sym)
    (list
     '(category . "polymorphic closure")
     (cons 'name (symbol->string name-sym))
     (cons 'args "")
     (list 'type)
     (cons 'docstring
           (let ((docstring (impc:ti:get-polyfunc-docstring (symbol->string name-sym)))
                 (poly-options-docstring
                  (string-join (map (lambda (pf)
                                      (let* ((option-name (vector-ref pf 0)))
                                        (string-append "@poly " option-name ":"
                                                       (impc:ir:pretty-print-type (vector-ref pf 1)))))
                                    (cl:remove-if
                                     (lambda (pf) (regex:match? (vector-ref pf 0) "_poly_"))
                                     (impc:ti:get-polyfunc-candidate-list (symbol->string name-sym))))
                               "\n")))
             (string-append docstring "\n\n" poly-options-docstring))))))


Back to Index