impc:ti:quote   scheme


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

Implementation

(define impc:ti:quote
  (lambda (ast)
    (cond ((null? ast) '(impc_null)) ;(list))
          ((symbol? ast)
           (let ((str (symbol->string ast)))
             (if (char=? #\' (car (reverse (string->list str))))
                 `(String ,(substring str 0 (- (string-length str) 1)))
                 `(Symbol ,str))))
          ((list? ast)
           (cons 'list (map (lambda (a)
                              (if (or (eq? 'NIL a)
                                      (null? a))
                                  '(list)
                                  a))
                            ast)))
          (else ast))))


Back to Index