Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8424123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:54:14+00:00 2026-06-10T03:54:14+00:00

Working on the following example in Clojure in Action (p. 63): (defn basic-item-total [price

  • 0

Working on the following example in “Clojure in Action” (p. 63):

(defn basic-item-total [price quantity] 
    (* price quantity))

(defn with-line-item-conditions [f price quantity] 
    {:pre [(> price 0) (> quantity 0)]
     :post [(> % 1)]} 
    (apply f price quantity))

Evaluating on the REPL:

(with-line-item-conditions basic-item-total 20 1)

Results in the following exception being thrown:

Don't know how to create ISeq from: java.lang.Long
  [Thrown class java.lang.IllegalArgumentException]

It appears the exception is being thrown after the apply procedure is evaluated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T03:54:16+00:00Added an answer on June 10, 2026 at 3:54 am

    The last argument to apply is supposed to be a sequence of arguments. In your case, the usage might look more like this:

    (defn with-line-item-conditions [f price quantity] 
        {:pre [(> price 0) (> quantity 0)]
         :post [(> % 1)]} 
        (apply f [price quantity]))
    

    apply is useful when you’re working with a list of arguments. In your case, you can simply call the function:

    (defn with-line-item-conditions [f price quantity] 
        {:pre [(> price 0) (> quantity 0)]
         :post [(> % 1)]} 
        (f price quantity))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the following (working) code example, the templated register_enum() function is used to iterate
I need a transformation of the following working curl command: curl --data-binary @data.txt http://www.example.com/request.asp
Say someone executes the following in a terminal: echo 'start working' > /etc/.example and
I was working the following example from Doug Hellmann tutorial on multiprocessing: import multiprocessing
I have found following working example of CGI with bash. If I change first
I'm have the following working example to retrieve a specific Wikipedia page that returns
The following example is working when I manualy replace T wirh char * ,
Consider the following example: <form action=process.php id=myForm> ..... ....... all my form elements </form>
I am working on creating page links from DB like the following example. Current
I am working in c++ under ubuntu. I have the following example: [car.h] #ifndef

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.