(apply str [2 3]) does the same thing as (str 2 3), which is to attempt to
convert each of its args to a string, then concatenate them all.

(apply inc [4 5]) does the same thing as (inc 4 5), which is to throw an
exception because inc takes exactly one argument and returns that value
plus 1.

This site has more examples of apply, and many other Clojure functions, too:

    http://clojuredocs.org/clojure_core/clojure.core/apply

Andy


On Sat, Aug 10, 2013 at 7:21 AM, drclj <deepikaro...@gmail.com> wrote:

> Hi there:
>
> Why does
>
> (apply str [2 3]) work
>
> and not
>
> (apply inc [4 5])
>
> though
>
> (apply inc [4])
>
> does work?
>
>
> Thanks.
>
> --
> --
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to