(define xtmdoc-closure-handler
(lambda (name-sym)
(list
'(category . "closure")
(cons 'name (symbol->string name-sym))
(cons 'args (xtmdoc-get-args-from-form (impc:ti:get-closure-body (symbol->string name-sym))))
(cons 'type (impc:ir:pretty-print-type (impc:ti:get-closure-type (symbol->string name-sym))))
(cons 'docstring
(let ((docstring (impc:ti:get-closure-docstring (symbol->string name-sym))))
(if (string=? docstring "") '() docstring))))))