(define-macro (impc:ti:get-mono-name closure-name . type)
(let* ((pair (regex:type-split (symbol->string closure-name) ":"))
(base (if (null? (cdr pair)) "" (impc:ir:get-base-type (cadr pair)))))
(set! closure-name (symbol->string closure-name))
(if (not (null? (cdr pair)))
(string-append (car pair) "_adhoc_" (cname-encode base) "_native")
(if (null? type)
(if (and (impc:ti:polyfunc-exists? closure-name)
(= (length (impc:ti:get-polyfunc-candidate-types closure-name)) 1))
(let* ((t (impc:ir:pretty-print-type (car (impc:ti:get-polyfunc-candidate-types closure-name))))
(bt (impc:ir:get-base-type t))
(fullname (string-append closure-name
"_adhoc_"
(cname-encode bt)
"")))
fullname)
(impc:compiler:print-compiler-error "Try forcing a type? Ambiguous call to get_native_fptr" (string->symbol closure-name)))
(let* ((bt (impc:ir:get-base-type (symbol->string (car type))))
(fullname (string-append closure-name
"_adhoc_"
(cname-encode bt)
"")))
fullname)))))