Experimental - like defmacro, except defines a named function whose
body is the expansion, calls to which may be expanded inline as if
it were a macro. Cannot be used with variadic (&) args.
Note that, as for macros, the arguments to definline are potentially subject to double evaluation if they are used more than once in the body. For example:
user=> (definline bad-sqr [x] `(* ~x ~x))
#'user/bad-sqr
user=> (bad-sqr (do (println "x") 5))
x
x
25
By , created 11.4 years ago
Any non-like-a-function behaviour should be avoided, because otherwise function will behave differently depending on whether it's inlined or not: