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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:53:10+00:00 2026-06-17T10:53:10+00:00

Suppose I have an application written in clojure which generates code while it is

  • 0

Suppose I have an application written in clojure which generates code while it is running. How can I debug that code – for which I do not have the source code?

Edit: I’m asking this question, because I was chatting about clojure with my colleague and he said that clojure programs are hard (or impossible) to test because of the reason stated above. I thought that this is a rater pessimistic approach. If it were untestable no one would’ve used it.

  • 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-17T10:53:11+00:00Added an answer on June 17, 2026 at 10:53 am

    Clojure gives you so much power so you don’t need debug developing style which is common in other less powerful languages like java, c++, etc.

    1. REPL. You can evaluate any function or expression anytime. You can prepare environment and reproduce the situation you need to test.
    2. Immutability. Clojure provides great immutable collections and pure functions library. Also there is STM that gives you full state control of your application. You can isolate mutable parts of your program from pure functional code and make those parts as small as possible so testing code responsible for state managing becomes much easier (in common cases). Testing the pure functional part is more fun and easy.
    3. Bottom-up programming. In clojure you can write code by small pieces. You’re playing with small pure functions until you can build underlying layer (library, dsl) for the next one in which you would continue this process. The testing small (pure) functions is very easy job.
    4. Logging. Obviously you can log any input parameter values at any point of code.

    If you keep this programming style you will reduce the chance when you really need debugging.
    You can do all the job by REPL in your case. You can get input parameters of functions that generate the “debugging” dynamic code by logging . After that you would get input parameters of this dynamic code in the same way. You would have both the generated “debugging” code and input parameters at the end. So you can easily reproduce situation and test it.

    Update. Regarding edited part of the question it’s not correct to say that “clojure programs are hard (or impossible) to test” just because your program generates code on the fly. Keep in mind that generated code is still the data which can be manipulated as usual data collections. You don’t need to build, run and freeze the whole application at the breakpoint to see what’s going on there. I’ve already described the way you can test your dynamic code.

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

Sidebar

Related Questions

Suppose I have a CMS application written in Node.js which persists data on a
Suppose I have an application written in native C++ (over 500k lines of code)
Suppose I have a web application, which uses jQuery for Ajax and UI. Now
Suppose I have a GUI-only application that runs on Windows and I'd like to
Suppose I have two Java projects in Maven / Eclipse: An open source application
Suppose that you have a big Data Entry Web Application Like Microsoft CRM ,
We have an old application that was written in Delphi 7. It is currently
I've written a sharepoint application that needs to change web.config I have a feature
Suppose you have an API you've written that collects data in real time in
I have a small report/logging application written in C#.NET 4.0 and WPF that I

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.