#() syntax can accept as many arguments as you like. For example, you
can define partial using #():
(defn partial [f & args]
#(apply f (concat args %&)))
On May 16, 7:13 pm, greg r wrote:
> The reader notation is limited to the arity of the number of arguments
> provided. partial allows varia
The reader notation is limited to the arity of the number of arguments
provided. partial allows variable arity.
Check out pages 67-68 of "Clojure Programming".
Regards,
Greg
On Wednesday, May 16, 2012 1:57:40 PM UTC-4, Murtaza Husain wrote:
>
> Hi,
>
> What is the idiomatic use of partial. I un
On Wed, May 16, 2012 at 1:57 PM, Murtaza Husain
wrote:
> What is the idiomatic use of partial. I understand it helps create closures,
> however the reader notation also allows to the same. So when should partial
> be use dover other forms of creating functions.
Also, for the sake of spamming of g
On Wed, May 16, 2012 at 1:57 PM, Murtaza Husain
wrote:
> What is the idiomatic use of partial. I understand it helps create closures,
> however the reader notation also allows to the same. So when should partial
> be use dover other forms of creating functions.
I have no idea if it is idiomatic o
On May 16, 2:05 pm, Stuart Sierra wrote:
> Every literal instance of `fn` or `#()` compiles to a new class definition.
> This is only at compile time: once the code is running, each execution of
> the `fn` expression merely creates an instance of that class.
>
> partial is implemented in terms of
Every literal instance of `fn` or `#()` compiles to a new class definition.
This is only at compile time: once the code is running, each execution of
the `fn` expression merely creates an instance of that class.
partial is implemented in terms of `fn`, so every usage of `partial` merely
creates
Someone once mentioned that partials are more performant. i.e. (partial
println "foo") is better than #(println "foo" %). I can't remember why,
something about creating classes under the covers, I believe. Hopefully
someone can chime in.
Personally, I used to use #(... %) due to it being less char
One of the best examples of partial that I've seen is in the
debug-repl...look it up on github and see how it is being used there in
the main function that starts the debug repl...basically every time you
invoke the debug-repl within the same repl session you're going to have
different local bi
Hi,
What is the idiomatic use of partial. I understand it helps create
closures, however the reader notation also allows to the same. So when
should partial be use dover other forms of creating functions.
Thanks,
Murtaza
--
You received this message because you are subscribed to the Google
Gr