:inline-arities tells the compiler, which arities (i.e. parameter counts)
should be inlined:
https://github.com/clojure/clojure/blob/9d70bc1051ec8117df6436e07474c586ea9e85b0/src/jvm/clojure/lang/Compiler.java#L6596
2015-07-09 9:49 GMT+02:00 Jo Geraerts :
>
>
> Op woensdag 8 juli 2015 05:20:51 UTC
Op woensdag 8 juli 2015 05:20:51 UTC+2 schreef Herwig Hochleitner:
>
> The way I would do it: Define multiply as a function calling (.multiply
> amount ^Number x), for higher order usage, and then add an :inline function
> to its metadata, which returns `(.multiply ~amount ~x).
> That acts as a
Good call on the auto-boxing. I wasn't considering that before, but
obviously it is important.
Nice insight into :inline. I never really did understand the usefulness of
it before.
On Tuesday, July 7, 2015 at 10:20:51 PM UTC-5, Herwig Hochleitner wrote:
>
> 2015-07-07 15:04 GMT+02:00 Jo Gerae
Herwig Hochleitner schreef op 2015-07-08 05:20:
2015-07-07 15:04 GMT+02:00 Jo Geraerts :
* multiply(long x)
* multiply(double x)
* multiply(Number x)
In clojure i want to do something like
(defn multiply[^MonetaryAmount amount multiplicant]
(.multiply amount multiplicant))
Function param
2015-07-07 15:04 GMT+02:00 Jo Geraerts :
>
> * multiply(long x)
> * multiply(double x)
> * multiply(Number x)
>
> In clojure i want to do something like
>
> (defn multiply[^MonetaryAmount amount multiplicant]
> (.multiply amount multiplicant))
>
Function parameters in Clojure, are generally pass