Move arg and ret types into the cfn call in defcfn
This is in preparation for an optimization in cfn with constant arg and ret types.
This commit is contained in:
parent
15c190572f
commit
d3050c34ff
1 changed files with 2 additions and 6 deletions
|
|
@ -549,8 +549,6 @@
|
||||||
:style/indent [:defn]}
|
:style/indent [:defn]}
|
||||||
[& args]
|
[& args]
|
||||||
(let [args (s/conform ::defcfn-args args)
|
(let [args (s/conform ::defcfn-args args)
|
||||||
args-types (gensym "args-types")
|
|
||||||
ret-type (gensym "ret-type")
|
|
||||||
address (gensym "symbol")
|
address (gensym "symbol")
|
||||||
native-sym (gensym "native")
|
native-sym (gensym "native")
|
||||||
[arity fn-tail] (-> args :wrapper :fn-tail)
|
[arity fn-tail] (-> args :wrapper :fn-tail)
|
||||||
|
|
@ -562,10 +560,8 @@
|
||||||
:single-arity [fn-tail]
|
:single-arity [fn-tail]
|
||||||
:multi-arity fn-tail
|
:multi-arity fn-tail
|
||||||
nil))]
|
nil))]
|
||||||
`(let [~args-types ~(:native-arglist args)
|
`(let [~address (find-symbol ~(name (:symbol args)))
|
||||||
~ret-type ~(:return-type args)
|
~native-sym (cfn ~address ~(:native-arglist args) ~(:return-type args))
|
||||||
~address (find-symbol ~(name (:symbol args)))
|
|
||||||
~native-sym (cfn ~address ~args-types ~ret-type)
|
|
||||||
fun# ~(if (:wrapper args)
|
fun# ~(if (:wrapper args)
|
||||||
`(fn ~(:name args)
|
`(fn ~(:name args)
|
||||||
~@fn-tail)
|
~@fn-tail)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue