Hi,
> (apply hash-map :a 1 [:b 2]) or (apply hash-map :a 1 :b 2 nil)
...or we could be more explicit and put:
user=> (apply hash-map :a 1 :b 2 {})
{:a 1, :b 2}
Best.
On Jul 19, 9:00 am, Meikel Brandmeyer <[email protected]> wrote:
> Hi,
>
> On Jul 19, 8:56 am, boyan <[email protected]> wrote:
>
> > I have a question about apply function.
> > For examle,create a hash map:
>
> > user=> (hash-map :a 1 :b 2)
> > {:a 1, :b 2}
>
> > It works fine,but if i want to use apply:
>
> > user=> (apply hash-map :a 1 :b 2)
> > java.lang.IllegalArgumentException: Don't know how to create ISeq from:
> > java.lang.Integer (NO_SOURCE_FILE:0)
>
> > Why it throw this exception?Is apply could not work with keyword? Any
> > solution?
>
> The last argument to apply has to be a sequence (or a thing you can
> call seq on).
>
> (apply hash-map :a 1 [:b 2]) or (apply hash-map :a 1 :b 2 nil)
>
> Sincerely
> Meikel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en