impc:ti:adhoc-scheme-wrapper   scheme


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

Implementation

(define impc:ti:adhoc-scheme-wrapper
  (lambda (polyname funcname)
    `(define ,(string->symbol polyname)
       (lambda args
         (if (and (not (null? args))
                  (symbol? (car args)))
             (if (equal? (car args) 'xtlang)
                 ',(string->symbol funcname)
                 (if (null? (cdr args))
                     (eval (string->sexpr (string-append "(" ,funcname "." (symbol->string (car args)) ")")))
                     (eval (append (string->sexpr (string-append "(" ,funcname "." (symbol->string (car args)) ")"))
                                   (list (cadr args))))))
             (apply ,(string->symbol funcname) args))))))


Back to Index