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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:51:36+00:00 2026-05-30T03:51:36+00:00

I have Clojure function that returns a LazySeq. When I run this function from

  • 0

I have Clojure function that returns a LazySeq. When I run this function from the REPL, it works just fine. However, if I try to call the same function from Java code like this:

Object result = com.acme.forecast.core.runforecast("file1.csv", "file2.txt");

I get the following exception:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: 
  clojure.lang.LazySeq cannot be cast to java.lang.Number
    at com.acme.forecast.core.runforecast(Unknown Source)
    at com.acme.forecast.client.gui.ClientGUI.actionPerformed(ClientGUI.java:180)

My gen-class says I’m returning a LazySeq, not a Number:

  (:gen-class
    :name com.acme.forecast.core
    :methods [#^{:static true} [runforecast [String String] clojure.lang.LazySeq]])

What is going wrong here?

  • 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-30T03:51:39+00:00Added an answer on May 30, 2026 at 3:51 am

    The error does say you’re returning LazySeq. The problem is that it’s trying to get stored in a Number, though I can’t see where in this code segment.

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

Sidebar

Related Questions

When I paste this code into a REPL, it works fine: (use 'clojure.contrib.seq-utils) (defn-
I have Clojure function that takes a sequence of numbers chops it into the
I have a problem with the Enclojure REPL and using clojure modules from it.
please help me understand this. You have a function that calls a few methods:
I have a function that returns a struct that has two fields, :key :event.
Suppose I have a function that returns a closure: sub generator { my $resource
I took this from Google Code Playground http://code.google.com/apis/ajax/playground/ /*CLOSURE * When a function is
I have some Clojure code that seems maddeningly simple and yet is throwing an
EDIT : This is just a simple example to demontrate the concern I have
I want to create a function that receives 2 arguments and returns a function

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.