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 6748387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:33:33+00:00 2026-05-26T12:33:33+00:00

More Clojure weirdness. I have this function I’m trying to define and call. It

  • 0

More Clojure weirdness. I have this function I’m trying to define and call. It has 3 arguments, but when I call it with 3 arguments I get

Wrong number of args (1) passed to: solr-query$correct-doc-in-results-QMARK-$fn
 [Thrown class clojure.lang.ArityException]

when I call it with 2 arguments I get

Wrong number of args (2) passed to: solr-query$correct-doc-in-results-QMARK-
  [Thrown class clojure.lang.ArityException]

and when I call it with 4 arguments I get

Wrong number of args (4) passed to: solr-query$correct-doc-in-results-QMARK-
  [Thrown class clojure.lang.ArityException]

here is the definition of the function:

(defn correct-doc-in-results? [query results docid]
  "Check if the docid we expected is returned in the results"
  (some #(.equals docid) (map :id (get results query))))

and here is how I’m trying to call it (from the REPL using swank in emacs):

(correct-doc-in-results? "FLASHLIGHT" all-queries "60184")

anyone have any idea what’s going on? Why does it think I’m only passing in 1 argument when I am passing 3, but gets it right for 2 or 4? I’m not a very fluent clojure programmer yet, but defining a function is pretty basic.

  • 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-05-26T12:33:33+00:00Added an answer on May 26, 2026 at 12:33 pm

    Note the difference between

    solr-query$correct-doc-in-results-QMARK-

    and

    solr-query$correct-doc-in-results-QMARK-$fn

    The first refers to your function correct-doc-in-results?. The latter refers to some anonymous function defined inside that function.

    If you pass 2 or 4 arguments, you’re getting an error for your toplevel function, as expected. When you pass 3 arguments, you’re getting an error for #(.equals docid), because #(.equals docid) wants zero arguments but is getting one. Try changing it to #(.equals % docid).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to wrap an external library in more idiomatic Clojure. This includes
Does Clojure specify the order of evaluation of function arguments? I.e. When I call
More particularly - I have a window handle of another running application. This application
I am a Clojure newbie. I am trying to get two copies of a
what is a more efficient way to accomplish this in clojure: (defn ones ([n]
I have installed clojure-box on my Windows 7 laptop, this by default installs emacsW32.
I'm trying to rewrite following snippet in clojure, but it all comes out ugly,
I've noticed over time that Clojure users have nothing but massive enthusiasm for the
Possible Duplicate: What is a ‘Closure’? I read more and more about closures but
More out of interest than anything else, but can you compile a DirectX app

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.