elmany (1) [Avatar] Offline
#1
Hi I'm using Clojure 1.4.0-master-SNAPSHOT

when I follow the example of the section
3.1.1 Defining functions
the with-line-item-conditions function give me this error:
IllegalArgumentException Don't know how to create ISeq from: java.lang.Long clojure.lang.RT.seqFrom (RT.java:492)

I tried them in the http://try-clojure.org/ and I got the same error.

Am I doing something wrong?
shaolang (3) [Avatar] Offline
#2
Re: with-line-item-conditions function give me an error
The documentation for apply is:
([f args* argseq])
Applies fn f to the argument list formed by prepending args to argseq.

In other words, apply expects the second parameter to be a sequence.
Therefore, when calling apply in with-line-item-conditions, you can use either of the following:

1. (apply f price [quantity])
2. (apply f [price quantity])

Hope this helps.
Greg r (2) [Avatar] Offline
#3
Re: with-line-item-conditions function give me an error
In the case of this function apply is not required.

Instead of
(apply f price quantity)

It should be

(f price quantity)

Regards,
Greg