xtmdoc-write-alist-as-json   scheme


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

Implementation

(define xtmdoc-write-alist-as-json
  (lambda (xtmdoc-alist file-port)
    (display "{\n  \"category\": " file-port)
    (write (cdr (assoc-strcmp 'category xtmdoc-alist)) file-port)
    (display ",\n  \"name\": " file-port)
    (write (cdr (assoc-strcmp 'name xtmdoc-alist)) file-port)
    (xtmdoc-write-alist-args-as-json xtmdoc-alist file-port)
    (display ",\n  \"type\": " file-port)
    (let ((type (cdr (assoc-strcmp 'type xtmdoc-alist))))
      (write (if (null? type) 'null type) file-port))
    (display ",\n  \"docstring\": " file-port)
    (let ((docstring (cdr (assoc-strcmp 'docstring xtmdoc-alist))))
      (write (if (null? docstring) 'null docstring) file-port))
    (display "\n}" file-port)))


Back to Index