Add function for making a varargs cfn factory with serde wrapper

This commit is contained in:
Joshua Suskalo 2021-09-25 08:38:56 -05:00
parent 2569b01eea
commit 65848c72eb

View file

@ -836,6 +836,18 @@
(make-downcall args ret) (make-downcall args ret)
(make-serde-wrapper args ret))) (make-serde-wrapper args ret)))
(defn vacfn-factory
"Constructs a varargs factory to call the native function referenced by `symbol`.
The function returned takes any number of type arguments and returns a
specialized Clojure function for calling the native function with those
arguments."
[symbol required-args ret]
(-> symbol
ensure-address
(make-varargs-factory required-args ret)
(make-serde-varargs-wrapper required-args ret)))
;;; Function types ;;; Function types
(def ^:private return-for-type (def ^:private return-for-type