> However, the fact that you can write funcall so easily as #(%1 %2) > illustrates that funcall adds no real expressiveness to the language, > whereas apply is really fundamental to being able to pass lists to > multi-arg functions. It's hard to imagine how to write apply at all if it > weren't built in to the language. > > funcall, on the other hand, can be described easily as "funcall is a > function that takes a function f, and a value v and applies f to v". > We write funcall the exact same way we write any other "function that > takes a blah and blah and does blah": > (defn funcall [f v] (f v)) > or as you noted, #(%1 %2). > > Since we have a way to apply a function to a value (i.e., (f v)), if you > want a function that applies a function to a value, you can easily express > that using ordinary techniques, if needed. >
Exactly. As I pointed out, Clojure users are hardly "out of luck" when confronted with a need for funcall. Quite the contrary: the function is *too trivial* to even deserve a name in the core namespace. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en