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

  • SEARCH
  • Home
  • 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 8260235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:03:23+00:00 2026-06-08T03:03:23+00:00

n = (count somevector) (foo [w] ( for [i (range n) j (range w)

  • 0
    n = (count somevector)        
   (foo [w] ( for [i (range n) 
                   j (range w)
                   :let [n (* i j)] 
                   :while ( < i j)
                  ] 
              (println n)))

When i run it.

=> (foo 10)
ClassCastException clojure.lang.LazySeq cannot be cast to clojure.lang.IFn HelloWorld.core/foo

What I am really looking to do is have a couple of nested for loops and have some ifs and else inside it do some checking.

Edit ::

As it turns out the following also causes error

(defn foo [arg]
 (      
      for [ i (range (count vector)) ]
      (
        for [j arg ]
        [i j]
        ) 

     ) ) 

IllegalArgumentException Don’t know how to create ISeq from: java.lang.Long clojure.lang.RT.seqFrom

Edit::

the following works

(defn foo [arg]
  (def w arg) 
(for [ i (range (count vector)) ]
      (
        for [j (range v)  ]
        [i j]
        )
  )   )

Now can someone help me understand why would it not work in the first place ?

  • 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-08T03:03:24+00:00Added an answer on June 8, 2026 at 3:03 am

    Don’t know how to create ISeq from: java.lang.Long clojure.lang.RT.seqFrom

    This error message states the cause of exception accurately.
    I guess you passed a long value where a seq is expected.
    I could reproduce it:

    user> (def v [1 2 3])
    #'user/v
    user> (defn foo [arg]
            (for [ i (range (count v)) ]
                 (for [j arg ]
                      [i j]))) 
    #'user/foo
    user> (foo (range 3))
    (([0 0] [0 1] [0 2]) ([1 0] [1 1] [1 2]) ([2 0] [2 1] [2 2]))
    user> (foo 3)
    ; Evaluation aborted.
    ; Don't know how to create ISeq from: java.lang.Long
    ;  [Thrown class java.lang.IllegalArgumentException]
    

    Your foo function works. However, the arg argument must be a seq,
    because arg is binded in the nested for to j

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

Sidebar

Related Questions

SELECT COUNT(*) INTO @count FROM `tableName` WHERE `id` = OLD.id; WHILE @count > -1
count the occurrences of each symbol and the location they appear in the text,
Count the longest sequence of heads and tails in 200 coin flips. I did
Does COUNT(*) have any significant impact for MySQL performance if query already has GROUP
if(count > 0){ for(var i= parseInt(start); i < parseInt(count); i++) { link ='<a href=/diabetes/ropimages/origpicdisplay.php?pid='+pid+'&rid='+i+'
TOPIC_COUNT_SQL = SELECT COUNT(*) FROM topics_topic WHERE topics_topic.object_id = maps_map.id AND topics_topic.content_type_id = %s
SELECT COUNT(`t`.id) FROM `product` `t` INNER JOIN `category` `c1` ON ( `c1`.id ='15' )
I want to count number of files in a folder in a remote host.
I need to count the length of an Ajax response done in jQuery. The
How to count the number of occurrence of a values in a dictionary in

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.