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]}
|
||||
[& args]
|
||||
(let [args (s/conform ::defcfn-args args)
|
||||
args-types (gensym "args-types")
|
||||
ret-type (gensym "ret-type")
|
||||
address (gensym "symbol")
|
||||
native-sym (gensym "native")
|
||||
[arity fn-tail] (-> args :wrapper :fn-tail)
|
||||
|
|
@ -562,10 +560,8 @@
|
|||
:single-arity [fn-tail]
|
||||
:multi-arity fn-tail
|
||||
nil))]
|
||||
`(let [~args-types ~(:native-arglist args)
|
||||
~ret-type ~(:return-type args)
|
||||
~address (find-symbol ~(name (:symbol args)))
|
||||
~native-sym (cfn ~address ~args-types ~ret-type)
|
||||
`(let [~address (find-symbol ~(name (:symbol args)))
|
||||
~native-sym (cfn ~address ~(:native-arglist args) ~(:return-type args))
|
||||
fun# ~(if (:wrapper args)
|
||||
`(fn ~(:name args)
|
||||
~@fn-tail)
|
||||
|
|
|
|||
Loading…
Reference in a new issue